Skip to content

Instantly share code, notes, and snippets.

@andresaquino
Created January 2, 2019 04:51
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 andresaquino/27e1ddd4ef8849a05159dd64b6ca99e7 to your computer and use it in GitHub Desktop.
Save andresaquino/27e1ddd4ef8849a05159dd64b6ca99e7 to your computer and use it in GitHub Desktop.
Image edition
# convert white color to transparency
convert <image.png> -fuzz 5% -transparent white <new-image.png>
# resize image to 24, 48, 64, 96 & 128 preserving ratio (width)
for isize in 24 48 64 96 128
do
ffmpeg -i <original-img.png> -vf scale=${isize}:-1 <image_${isize}.png>
done
# resize image to 24, 48, 64, 96 & 128 preserving ratio (height)
for isize in 24 48 64 96 128
do
ffmpeg -i <original-img.png> -vf scale=-1:${isize} <image_${isize}.png>
done
# vim: ft=sh:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment