Skip to content

Instantly share code, notes, and snippets.

@clarityflowers

clarityflowers/dither

Last active Jan 28, 2021
Embed
What would you like to do?
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