-
-
Save ddneat/4aa439d3d57d02e024b3 to your computer and use it in GitHub Desktop.
This file contains 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
# Flatten a transparent image with a white background: | |
convert -flatten img1.png img1-white.png | |
# Make an image transparent | |
convert -transparent '#FFFFFF' nontransparent.gif transparent.png | |
# convert an image into tiles | |
convert -size 3200x3200 tile:single_tile.png final.png | |
# making a montage from a collection of images | |
montage -geometry +0+0 -background transparent *png montage.png | |
# inverting colors | |
convert before.png -negate after.png | |
# generating a favicon | |
convert large_image.png -resize 16x16! favicon.ico | |
convert large_image.png -resize 32x32! favicon.ico | |
# generating a sprite (+/-) | |
convert *.png +append sprites.png | |
convert *.png -append sprites.png |
This file contains 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
# adding numbers to a tiled image | |
cmd = (0..324).to_a.inject([]) do |cmd,n| | |
y=(n/25*32)+15; x=((n%25)*32)+15 | |
cmd << "-draw 'fill red text #{x},#{y} \"#{n}\"'" | |
end | |
`convert img.png #{cmd.join(' ')} annotated_img.png` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment