Maybe it is the expected behaviour, but considering a 200x200 PNG image with a 100 px border — that makes it 400x400.
We have :
Code: Select all
$ convert input.png -trim output.png
$ identify output.png
output.png PNG 200x200 400x400+100+100 8-bit sRGB 12.9KB 0.000u 0:00.000
This doesn't seem to be much an issue most of the time, since the geometry information seems discarded by most programs.
However, it is not always discarded by ImageMagick itself. Namely :
Code: Select all
$ convert output.png issue.pdf
$ identify issue.pdf
issue.pdf PDF 400x400 400x400+0+0 16-bit Bilevel Gray 20.1KB 0.000u 0:00.000
Code: Select all
$ convert input.png -trim failed.pdf
$ identify failed.pdf
failed.pdf PDF 400x400 400x400+0+0 16-bit Bilevel Gray 20.1KB 0.000u 0:00.000
This is quite misleading when you are dealing with images with borders larger than the illustration, and the PDF output is always blank/empty…
I'm running ImageMagick 6.9.2.7-1 from Fedora 23.