Skip to content

Instantly share code, notes, and snippets.

@clarityflowers
Last active January 28, 2021 09:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarityflowers/47003dc2817072fa1778776b62d291e8 to your computer and use it in GitHub Desktop.
Save clarityflowers/47003dc2817072fa1778776b62d291e8 to your computer and use it in GitHub Desktop.
Make a little dithered image
#!/bin/bash
USAGE="${0##*/} <origin> <dest> <size> <num-colors> [<filter-color> <filter-amount>]"
if [[ $1 == --help ]]; then
echo $USAGE
elif [[ -n $5 ]]; then
magick $1 -dither Floyd-Steinberg -resize $3 -colors $4 \
\( +clone -fill $5 -colorize $6 \) -compose dissolve \
-define compose:args=25 -colors $4 -composite \
$2 && open -a Preview $2
else
magick $1 -dither Floyd-Steinberg -resize $3 -colors $4 \
$2 && open -a Preview $2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment