From d70dc4ff13b97b4560203d49f1cfa8e9f23ec321 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Tue, 13 Jul 2021 20:38:46 -0500 Subject: Rewrite logo composition/generation logic. Update '.gitignore' to exclude generated files. --- assets/images/polyguin.sh | 90 +++++++++++++++++++++++++++- assets/images/polylogo_black.png | Bin 157309 -> 0 bytes assets/images/polylogo_black.psd | Bin 1731368 -> 0 bytes assets/images/polylogo_black_color.png | Bin 96033 -> 0 bytes assets/images/polylogo_black_color.psd | Bin 584478 -> 0 bytes assets/images/polylogo_black_color_x200.png | Bin 19469 -> 0 bytes assets/images/polylogo_black_color_x28.png | Bin 3223 -> 0 bytes assets/images/polylogo_black_color_x54.png | Bin 5535 -> 0 bytes assets/images/polylogo_black_x200.png | Bin 13960 -> 0 bytes assets/images/polylogo_black_x28.png | Bin 2664 -> 0 bytes assets/images/polylogo_black_x54.png | Bin 4236 -> 0 bytes assets/images/polylogo_template_black.psd | Bin 0 -> 421864 bytes assets/images/polylogo_template_white.psd | Bin 0 -> 333588 bytes assets/images/polylogo_white.png | Bin 157093 -> 0 bytes assets/images/polylogo_white.psd | Bin 1642532 -> 0 bytes assets/images/polylogo_white_color.png | Bin 96462 -> 0 bytes assets/images/polylogo_white_color.psd | Bin 496340 -> 0 bytes assets/images/polylogo_white_color_x200.png | Bin 20866 -> 0 bytes assets/images/polylogo_white_color_x28.png | Bin 3320 -> 0 bytes assets/images/polylogo_white_color_x54.png | Bin 5821 -> 0 bytes assets/images/polylogo_white_x200.png | Bin 14700 -> 0 bytes assets/images/polylogo_white_x28.png | Bin 2697 -> 0 bytes assets/images/polylogo_white_x54.png | Bin 4381 -> 0 bytes 23 files changed, 88 insertions(+), 2 deletions(-) delete mode 100644 assets/images/polylogo_black.png delete mode 100755 assets/images/polylogo_black.psd delete mode 100644 assets/images/polylogo_black_color.png delete mode 100755 assets/images/polylogo_black_color.psd delete mode 100644 assets/images/polylogo_black_color_x200.png delete mode 100644 assets/images/polylogo_black_color_x28.png delete mode 100644 assets/images/polylogo_black_color_x54.png delete mode 100644 assets/images/polylogo_black_x200.png delete mode 100644 assets/images/polylogo_black_x28.png delete mode 100644 assets/images/polylogo_black_x54.png create mode 100755 assets/images/polylogo_template_black.psd create mode 100755 assets/images/polylogo_template_white.psd delete mode 100644 assets/images/polylogo_white.png delete mode 100755 assets/images/polylogo_white.psd delete mode 100644 assets/images/polylogo_white_color.png delete mode 100755 assets/images/polylogo_white_color.psd delete mode 100644 assets/images/polylogo_white_color_x200.png delete mode 100644 assets/images/polylogo_white_color_x28.png delete mode 100644 assets/images/polylogo_white_color_x54.png delete mode 100644 assets/images/polylogo_white_x200.png delete mode 100644 assets/images/polylogo_white_x28.png delete mode 100644 assets/images/polylogo_white_x54.png (limited to 'assets') diff --git a/assets/images/polyguin.sh b/assets/images/polyguin.sh index 97a2ab0..1bf0df4 100755 --- a/assets/images/polyguin.sh +++ b/assets/images/polyguin.sh @@ -1,5 +1,13 @@ #!/bin/sh -e +HERE=$(dirname $(readlink -f ${0})); +cd ${HERE}; + +rm -f gen_*; + +#--------------------------------------------------------------- +# Transparent monochrome (B on W, W on B) SVGs from master. + ## # Target: color # @@ -78,7 +86,85 @@ grep fill: polyguin.svg \ done \ ; + +#=============================================================== +docker run -v$(pwd):/x -w/x --rm -i alpine:3.14 <<'EOF' +apk add graphicsmagick imagemagick; +#=============================================================== + +#--------------------------------------------------------------- +# SVG master --> scaled PNGs for composition onto logo template. + +## +# SVG --> PNG for master logo icon. +# +# x28 is GitLab +# x54 is Website +# x200 is SPI project page +# +# This runs inside Docker because of ImageMagick bugs and GM is +# the only free software I can find that doesn't screw this up. +# +for c in color black white; do +for r in x28 x54 x200; do + gm convert -trim -density 600 -resize ${r} -background none polyguin_${c}.svg gen_polyguin_${c}_${r}.png; + chown 1000:1000 gen_polyguin_${c}_${r}.png; +done # r +done # c + + +#--------------------------------------------------------------- +# PSD master --> scaled PNGs for composition onto logo template. + ## -# SVG --> PNG +# PSD --> PNG for master logo icon. # -docker run -v$(pwd):/root --rm -it alpine:latest sh -c 'apk add graphicsmagick; cd; gm convert -trim -density 200 -resize x1000 -background none polyguin.svg polyguin.png; chown 1000:1000 polyguin.png' +# x28 is GitLab +# x54 is Website +# x200 is SPI project page +# +# GM does not support PSD anymore! +# +find . -type f -name "*.psd" | cut -d'/' -f2 | while read k; do +for r in x28 x54 x200; do + magick convert -resize ${r} "${k}[0]" "gen_${k%*.psd}_${r}.png"; + chown 1000:1000 "gen_${k%*.psd}_${r}.png"; +done +done + +#--------------------------------------------------------------- +# SVG + PSD template composition. + +## +# Contrast suffers a bit but these are great on image backgrounds. +# +for c in color black white; do +for r in x28 x54 x200; do + # transparent black polyguin + gm composite gen_polyguin_${c}_${r}.png gen_polylogo_template_black_${r}.png gen_polylogo_black_${c}_${r}.png; + chown 1000:1000 gen_polylogo_black_${c}_${r}.png; + + # transparent white polyguin + gm composite gen_polyguin_${c}_${r}.png gen_polylogo_template_white_${r}.png gen_polylogo_white_${c}_${r}.png; + chown 1000:1000 gen_polylogo_white_${c}_${r}.png; +done # r +done # c + +## +# These have better contrast and are suited for solid backgrounds. +# +# FIXME: improve contrast. +# +for r in x28 x54 x200; do + # solid black color --> grayscale polyguin + magick convert -colorspace Gray -contrast-stretch 0 gen_polylogo_black_color_${r}.png gen_polylogo_black_mono_${r}.png; + chown 1000:1000 gen_polylogo_black_mono_${r}.png; + + # solid white color --> grayscale polyguin + magick convert -colorspace Gray -contrast-stretch 0 gen_polylogo_white_color_${r}.png gen_polylogo_white_mono_${r}.png; + chown 1000:1000 gen_polylogo_black_mono_${r}.png; +done # r + +#=============================================================== +EOF +#=============================================================== diff --git a/assets/images/polylogo_black.png b/assets/images/polylogo_black.png deleted file mode 100644 index 90f64ed..0000000 Binary files a/assets/images/polylogo_black.png and /dev/null differ diff --git a/assets/images/polylogo_black.psd b/assets/images/polylogo_black.psd deleted file mode 100755 index 02e2259..0000000 Binary files a/assets/images/polylogo_black.psd and /dev/null differ diff --git a/assets/images/polylogo_black_color.png b/assets/images/polylogo_black_color.png deleted file mode 100644 index 635fafd..0000000 Binary files a/assets/images/polylogo_black_color.png and /dev/null differ diff --git a/assets/images/polylogo_black_color.psd b/assets/images/polylogo_black_color.psd deleted file mode 100755 index 65802cb..0000000 Binary files a/assets/images/polylogo_black_color.psd and /dev/null differ diff --git a/assets/images/polylogo_black_color_x200.png b/assets/images/polylogo_black_color_x200.png deleted file mode 100644 index dae22a5..0000000 Binary files a/assets/images/polylogo_black_color_x200.png and /dev/null differ diff --git a/assets/images/polylogo_black_color_x28.png b/assets/images/polylogo_black_color_x28.png deleted file mode 100644 index ccb0d23..0000000 Binary files a/assets/images/polylogo_black_color_x28.png and /dev/null differ diff --git a/assets/images/polylogo_black_color_x54.png b/assets/images/polylogo_black_color_x54.png deleted file mode 100644 index ea8bd8a..0000000 Binary files a/assets/images/polylogo_black_color_x54.png and /dev/null differ diff --git a/assets/images/polylogo_black_x200.png b/assets/images/polylogo_black_x200.png deleted file mode 100644 index 4ee92bc..0000000 Binary files a/assets/images/polylogo_black_x200.png and /dev/null differ diff --git a/assets/images/polylogo_black_x28.png b/assets/images/polylogo_black_x28.png deleted file mode 100644 index bb7b6ee..0000000 Binary files a/assets/images/polylogo_black_x28.png and /dev/null differ diff --git a/assets/images/polylogo_black_x54.png b/assets/images/polylogo_black_x54.png deleted file mode 100644 index 205d1b3..0000000 Binary files a/assets/images/polylogo_black_x54.png and /dev/null differ diff --git a/assets/images/polylogo_template_black.psd b/assets/images/polylogo_template_black.psd new file mode 100755 index 0000000..e06d303 Binary files /dev/null and b/assets/images/polylogo_template_black.psd differ diff --git a/assets/images/polylogo_template_white.psd b/assets/images/polylogo_template_white.psd new file mode 100755 index 0000000..993ab61 Binary files /dev/null and b/assets/images/polylogo_template_white.psd differ diff --git a/assets/images/polylogo_white.png b/assets/images/polylogo_white.png deleted file mode 100644 index 504e51c..0000000 Binary files a/assets/images/polylogo_white.png and /dev/null differ diff --git a/assets/images/polylogo_white.psd b/assets/images/polylogo_white.psd deleted file mode 100755 index 43370f3..0000000 Binary files a/assets/images/polylogo_white.psd and /dev/null differ diff --git a/assets/images/polylogo_white_color.png b/assets/images/polylogo_white_color.png deleted file mode 100644 index a0afd5c..0000000 Binary files a/assets/images/polylogo_white_color.png and /dev/null differ diff --git a/assets/images/polylogo_white_color.psd b/assets/images/polylogo_white_color.psd deleted file mode 100755 index a08c61a..0000000 Binary files a/assets/images/polylogo_white_color.psd and /dev/null differ diff --git a/assets/images/polylogo_white_color_x200.png b/assets/images/polylogo_white_color_x200.png deleted file mode 100644 index 14847b3..0000000 Binary files a/assets/images/polylogo_white_color_x200.png and /dev/null differ diff --git a/assets/images/polylogo_white_color_x28.png b/assets/images/polylogo_white_color_x28.png deleted file mode 100644 index e86b1d5..0000000 Binary files a/assets/images/polylogo_white_color_x28.png and /dev/null differ diff --git a/assets/images/polylogo_white_color_x54.png b/assets/images/polylogo_white_color_x54.png deleted file mode 100644 index 39cd211..0000000 Binary files a/assets/images/polylogo_white_color_x54.png and /dev/null differ diff --git a/assets/images/polylogo_white_x200.png b/assets/images/polylogo_white_x200.png deleted file mode 100644 index adaf530..0000000 Binary files a/assets/images/polylogo_white_x200.png and /dev/null differ diff --git a/assets/images/polylogo_white_x28.png b/assets/images/polylogo_white_x28.png deleted file mode 100644 index fb3c82d..0000000 Binary files a/assets/images/polylogo_white_x28.png and /dev/null differ diff --git a/assets/images/polylogo_white_x54.png b/assets/images/polylogo_white_x54.png deleted file mode 100644 index 75a6e61..0000000 Binary files a/assets/images/polylogo_white_x54.png and /dev/null differ -- cgit v1.2.3-70-g09d2