Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
magick wrote: ↑2017-04-03T06:22:41-07:00
Add -fuzz 5% -trim to your command-line. Does that help?
It does help, but it will take at least 47% of fuzz to make a difference in the given case. Is this expected? I’m surprised by this since the underlying PDF is the same in both cases, and setting density to even values never requires any fuzz (which is expected since the input background is completely uniform). This is for an automatic usecase, so ideally no fuzz should be needed when the background is uniform.
Does using odd DPI values introduce any noise that would explain this behavior?
I have no problem using -fuzz 1% with -density 300. The density should have no bearing on the trim. I am using IM 6.9.8.3 Q16 Mac OSX. Perhaps it has to do with your version of Ghostscript. I am using GS 9.19
fmw42 wrote: ↑2017-04-03T09:31:29-07:00
I have no problem using -fuzz 1% with -density 300. The density should have no bearing on the trim. I am using IM 6.9.8.3 Q16 Mac OSX. Perhaps it has to do with your version of Ghostscript. I am using GS 9.19
As indicated in the description, the density does seem to have a (erroneous?) bearing on the trim for some reason. Density 300, 302, etc. works for me too, but when using 299, 301, 303, the image will only be trimmed horizontally. As for GS, I’m using v. 9.21.
Resterizing a PDF at different densities will create a different size image, so could make a slight but important difference that could prevent a trim. But that doesn't seem to be happening here.
For any image, a second trim should have no effect. But it does here: