Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2011-10-29T20:13:11-07:00
Image cropping is performed relative to the 'Page Geometry' or 'Virtual Canvas' of the image. Not to the actual image..
Code: Select all
identify -verbose kk-1.png
...
Geometry: 20x128+0+0
...
Page geometry: 100x131+10+1
...
Basically the image is not saved the way you are expecting! You missed a +repage after some crop at some point.
See
http://www.imagemagick.org/Usage/crop/#crop
Try this.
Code: Select all
convert kk-1.png +repage -crop 20x286+1+1 +repage result.png
better still...
Code: Select all
convert kk-1.png +repage -shave 0x1 result.png
shave works on the real image not the virtual canvas.
linjuming
Posts: 122 Joined: 2011-01-25T00:09:50-07:00
Authentication code: 8675308
Post
by linjuming » 2011-10-29T20:42:26-07:00
understand ! thank you very much !