fragileandys wrote:Anthony
So if the image is cropped in an outside program that saves the virtual canvas (the default 'preview' on a Mac), there's nothing I can do about it?
No, if the virtual-canvas is saved (and I don't know if Preview does that), all you need to do is add +repage after reading in your cropped image.
convert croppedimage.png +repage ....
PNG saves a virtual canvas, jpg does not.
You can check if your image has a virtual-canvas, by looking at the verbose info.
convert image -verbose info:
Look for the line near the bottom that is "page geometry" and see if it is the same size and zero offset as the image. If not, then there is a virtual canvas.
Or from identify
convert logo: -gravity center -crop 50x50%+0+0 logo.png
identify logo.png
logo.png PNG
320x240 640x480+160+120 8-bit PseudoClass 226c 14.5KB 0.000u 0:00.000
The blue is the actual image size. The red is the virtual canvas.
P.S. On my Mac OSX Snow Leopard, I tried to crop an image with Preview. But it does not look like it saves the virtual canvas for me. So I am puzzled why you are having this problem.