extending from "how to get the color value of a point (2)?"
now some problem occur.
why can not i remove the 1px of top border ?
source png:
description:
why can not i remove the 1px of top border ?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: why can not i remove the 1px of top border ?
Image cropping is performed relative to the 'Page Geometry' or 'Virtual Canvas' of the image. Not to the actual image..
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.
better still...
shave works on the real image not the virtual canvas.
Code: Select all
identify -verbose kk-1.png
...
Geometry: 20x128+0+0
...
Page geometry: 100x131+10+1
...
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
Code: Select all
convert kk-1.png +repage -shave 0x1 result.png
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: why can not i remove the 1px of top border ?
understand ! thank you very much !