Skip to content

Instantly share code, notes, and snippets.

@arussellsaw
Created March 17, 2023 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arussellsaw/57bfc43f8583529796d3171c6319fd42 to your computer and use it in GitHub Desktop.
Save arussellsaw/57bfc43f8583529796d3171c6319fd42 to your computer and use it in GitHub Desktop.
#!/bin/zsh
for palette in $(ls palettes/)
do
echo $palette
for file in $(ls |grep -v palette |grep -v .sh)
do
echo $file
convert $file \
-resize 400x \
+dither /tmp/resized.png
convert /tmp/resized.png \
-define dither:diffusion-amount=12% \
-dither FloydSteinberg \
-remap palettes/$palette /tmp/remapped.png
convert /tmp/remapped.png \
-scale 1920x \
-quality 100 \
${file%.*}-${palette%.*}.png
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment