Last active
October 15, 2020 15:02
-
-
Save kana/c4efaba000b3b33cbd55ccc8ca92a773 to your computer and use it in GitHub Desktop.
ImageMagick usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tweaked http://www.imagemagick.org/Usage/thumbnails/#rounded_border | |
convert -size 500x500 -alpha transparent xc:none -fill none -stroke black -strokewidth 4 -draw 'roundrectangle 1,1 498,498 12,12' ,border.png | |
convert -size 500x500 -alpha transparent xc:white -fill black -stroke transparent -strokewidth 4 -draw 'roundrectangle 0,0 499,499 12,12' ,mask.png | |
convert -background black src.jpg -resize '500^x500^' -gravity center -extent 500x500 -alpha set \ | |
,mask.png -compose DstIn -composite \ | |
,border.png -compose Over -composite \ | |
bordered.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.imagemagick.org/Usage/transform/#evaluate | |
convert rose: -alpha set -channel A -evaluate divide 2 rose_transparent.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs=($(ls [^t]*.jpg | shuf)) | |
convert \( \ | |
\( tt-${fs[0]} tt-${fs[1]} -append \) \ | |
\( tt-${fs[2]} tt-${fs[3]} -append \) \ | |
+append \ | |
\) \ | |
t-${fs[4]} \ | |
\( \ | |
\( tt-${fs[5]} tt-${fs[6]} -append \) \ | |
\( tt-${fs[7]} tt-${fs[8]} -append \) \ | |
+append \ | |
\) \ | |
+append \ | |
,mosaic.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://legacy.imagemagick.org/Usage/masking/#bg_remove | |
convert cyclops.png -bordercolor white -border 1x1 \ | |
-alpha set -channel RGBA -fuzz 20% \ | |
-fill none -floodfill +0+0 white \ | |
-shave 1x1 cyclops_flood_3.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment