Page 1 of 1

-linear-stretch

Posted: 2015-02-26T19:34:17-07:00
by afre
For ImageMagick 6.9.0-6 Q32 x86_64 (WIN) when doing

Code: Select all

convert logo: -linear-stretch 5x5 logo.png
all or some of the image turns white, like this.

Re: -linear-stretch

Posted: 2015-02-26T21:06:33-07:00
by fmw42
Your command works fine for me on the logo image on IM 6.9.0.7 Q16 Mac OSX. If it is on other images, then post the input and your output.

Note that 5x5 is just 5 graylevels out of 65535 on Q16. It should be miniscule on Q32. I always use percents rather than raw values so that it does not matter what Q level I am using. I don't really use Q32. If I want high quality, I use Q16 HDRI. I do not see much point in Q32. But perhaps you have a requirement that I have not given consideration.

Re: -linear-stretch

Posted: 2015-02-26T21:30:55-07:00
by snibgo
For v6.9.0-0 on Windows 8.1:

The Windows standard Q16 integer distribution does not show this bug.

On self-compiled (with Cygwin):

Q8 and Q16 (integer and HDRI) don't show the bug.

Q32 and Q64, integer and HDRI, do show the bug.

I suspect the bug is similar to one I reported some time ago, where an array index was mis-scaled.

Re: -linear-stretch

Posted: 2015-02-27T01:00:17-07:00
by snibgo
I haven't checked this by applying a patch, but I think the problem is in enhance.c. Function LevelImageChannel() has parameters black_point and white_point, which that function thinks are in the range 0 to QuantumRange. However, it is frequently called with those parameters in the range 0 to MaxMap.

For Q8 and Q16, MaxMap == QuantumRange. For Q32 and Q64, MaxMap != QuantumRange.

Re: -linear-stretch

Posted: 2015-02-27T04:01:12-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.9.0-8 Beta, available by sometime tomorrow. Thanks.