Modulate change pending

Bob Friesenhahn <[email protected]> Sun, 12 Dec 2004 18:33:19 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.tools,gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
The ImageMagick/GraphicsMagick -modulate definition (Modulate() API 
function) has been broken since since its conception.  The problem is 
that in HSL space, hue is actually a rotation of 0 to 360 degrees. 
It does not make sense to adjust hue by a percentage of its current 
value.  Doing so corrupts the image whenever the value crosses the 
threshold between 0 and 360 degrees and results in unpredictable 
adjustments.

Due this problem, I have decided to adjust how the hue parameter is 
handled as follows:

  "Hue is a rotation (not something you have less or more of) so
   modulating the hue by 50% causes an absolute counter-clockwise
   rotation of 90 degrees, and modulating by 150% causes an absolute
   clockwise rotation of 90 degrees.  Modulating by 0 or 200% causes a
   rotation of 180 degrees, resuling in the same effect."

This allows an existing -modulate argument of

  -modulate 100,100,100

to result in the same image as it does now, the default hue value 
is still the same, and the API is not radically changed.

The end results are similar to those in Photoshop.

Please let me know if you see a problem with this change.  For 
example, should a 200% adjustment represent 180 degrees (as far away 
as possible), or should it represent 360 degrees (back where we 
started).

Bob
======================================
Bob Friesenhahn
[email protected]
http://www.simplesystems.org/users/bfriesen


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/