Hello!
I've found a bug in modulate that only occurs in HDRI enabled ImageMagick 6.6.0-9 apparently.
convert_hdri input.ppm -modulate 100,150,100 -depth 8 -quality 98 -sampling-factor 1x1 output_hdri.jpg
convert_normal input.ppm -modulate 100,150,100 -depth 8 -quality 98 -sampling-factor 1x1 output_normal.jpg
The input and output files are here:
http://rnbc.dyndns.org/pub/imagemagick_ ... dri.tar.gz
The results:
HDRI:
Normal/16bpp:
The normal version is the one that comes in Ubuntu 9.10:
Version: ImageMagick 6.5.1-0 2009-08-27 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
The other was compiled by myself with HDRI enabled:
Version: ImageMagick 6.6.0-9 2010-04-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: HDRI OpenMP
Bug in modulate with HDRI (6.6.0-9)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Bug in modulate with HDRI (6.6.0-9)
The modulate color space was changed. see http://www.imagemagick.org/Usage/color/ ... colorspace
"Before IM v6.4.0-10 the "-modulate" actually did use HSB color space rather than HSL colorspace. This was changed because of a bug report by a user about the above situation."
"To modulate the image in HSB Color Space, as of IM v6.5.3-7, you can "-set" the 'special' option 'option:modulate:colorspace' with one of the 'Hue' color spaces. EG: HSL, HSB, or HWB."
So be sure you are using the same color space which probably should be HSB to make it the same. Then see if you get the same error.
"Before IM v6.4.0-10 the "-modulate" actually did use HSB color space rather than HSL colorspace. This was changed because of a bug report by a user about the above situation."
"To modulate the image in HSB Color Space, as of IM v6.5.3-7, you can "-set" the 'special' option 'option:modulate:colorspace' with one of the 'Hue' color spaces. EG: HSL, HSB, or HWB."
So be sure you are using the same color space which probably should be HSB to make it the same. Then see if you get the same error.
Re: Bug in modulate with HDRI (6.6.0-9)
Yes, I get the same error, with all 3 colorspaces...
You can test yourself with the input file I sent. Please tell me if you can't reproduce the result.
This is a problem with hdri-enabled ImageMagick only, just tested ImageMagick-6.6.0-9 with HDRI disabled and it works fine in all colorspaces!
You can test yourself with the input file I sent. Please tell me if you can't reproduce the result.
This is a problem with hdri-enabled ImageMagick only, just tested ImageMagick-6.6.0-9 with HDRI disabled and it works fine in all colorspaces!
Re: Bug in modulate with HDRI (6.6.0-9)
HDRI permits pixel values to go negative or exceed the quantum range. For non-HDRI image formats, you need to clamp the pixel values like this:
- convert input.ppm -modulate 100,150,100 -clamp -depth 8 -quality 98 -sampling-factor 1x1 output_hdri.jpg
Re: Bug in modulate with HDRI (6.6.0-9)
I just tested with clamp. In fact with clamp before, after... in generous amounts... to no avail.
Have you tested with the PPM I've put in the first post?
Have you tested with the PPM I've put in the first post?
Re: Bug in modulate with HDRI (6.6.0-9)
We're using ImageMagick 6.6.1-2 and testing under Linux although it should not matter. We get the blue around the arm rests without the clamp option and get the normal image when we include -clamp on the command line.
Re: Bug in modulate with HDRI (6.6.0-9)
Ok, it works if -clamp is made exactly before conversion to 8 bits and saving. If I make any other operation, even -auto-level, which presumably normalizes images from 0.0 to 1.0, after -clamp ... if won't work.
Except if I don't use -modulate. Other operations alone and together like -linear-stretch or -gamma or -sigmoidal-contrast work fine without clamp, except if there is a -modulate around.
It's definitely workable, but still a weird behavior
Thanks for the fix guys!
Except if I don't use -modulate. Other operations alone and together like -linear-stretch or -gamma or -sigmoidal-contrast work fine without clamp, except if there is a -modulate around.
It's definitely workable, but still a weird behavior
Thanks for the fix guys!
Re: Bug in modulate with HDRI (6.6.0-9)
- It's definitely workable, but still a weird behavior
Re: Bug in modulate with HDRI (6.6.0-9)
Hum... interesting it's only in HSL, because as I wrote previously the error occurred with all 3 colorspaces supported by modulate, unless I was doing something wrong
I'll check it tomorrow, as soon as I get my hands on that new version
Thanks again for the fast answer! I'm using ImageMagick as part of an HDRI pipeline for image edition on the web (a new PhpBB3 module in fact), and for example a bug I reported in pfstools a few weeks ago is still unanswered. I think they haven't even looked at my mail yet
I'll check it tomorrow, as soon as I get my hands on that new version
Thanks again for the fast answer! I'm using ImageMagick as part of an HDRI pipeline for image edition on the web (a new PhpBB3 module in fact), and for example a bug I reported in pfstools a few weeks ago is still unanswered. I think they haven't even looked at my mail yet
Re: Bug in modulate with HDRI (6.6.0-9)
Ok, the bug in modulate seems solved, now I have another one... in another thread