Discussion:
croping image to visible area
Marcin S
2011-04-19 11:12:21 UTC
Permalink
Hello,

a have a bundle of B/W images, size 128x64. Let me show You a sample

https://picasaweb.google.com/lh/photo/1EAL-kfbV4PdevJESGDOEW8pL2HRQALB594k7UVmewY?feat=directlink

Im trying to figure out convert command to crop out this little white
piece and resize image to croped area (it's repage command i think).
Its something like "Image->Autocrop Image" in gimp if You have it.

anyideas?
Fred Weinhaus
2011-04-19 16:51:54 UTC
Permalink
Post by Marcin S
Im trying to figure out convert command to crop out this little white
piece and resize image to croped area (it's repage command i think).
Its something like "Image->Autocrop Image" in gimp if You have it.
Your image has two frames. The second is only 1x1. So you want to
process only the first frame.

convert el-306.gif[0] -trim +repage el-306_f0_trim.gif

However, as your white spot is not rectangular, the trim will get a
bounding rectangle that will show some black as well as the white. It
should end up as 5x5 pixels in widthxheight.

see http://www.imagemagick.org/Usage/crop/#trim
Marcin S
2011-04-20 09:00:18 UTC
Permalink
That is exactly what I wanted =]

now i need to add 1px red border, but i think ill manage

Thanks
Post by Fred Weinhaus
Post by Marcin S
Im trying to figure out convert command to crop out this little white
piece and resize image to croped area (it's repage command i think).
Its something like "Image->Autocrop Image" in gimp if You have it.
Your image has two frames. The second is only 1x1. So you want to
process only the first frame.
convert el-306.gif[0] -trim +repage el-306_f0_trim.gif
However, as your white spot is not rectangular, the trim will get a
bounding rectangle that will show some black as well as the white. It
should end up as 5x5 pixels in widthxheight.
see http://www.imagemagick.org/Usage/crop/#trim
_______________________________________________
Magick-users mailing list
http://studio.imagemagick.org/mailman/listinfo/magick-users
Loading...