MagickSigmoidalContrastImage

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Hilbert

MagickSigmoidalContrastImage

Post by Hilbert »

Greetings all,

I'm still pretty new to IM, but I'm trying to use "MagickSigmoidalContrastImage" in the MagickWand API http://www.imagemagick.org/api/magick-i ... trastImage

I don't understand the arguments: alpha: "control the "shoulder" of the contast curve." and beta: "control the "toe" of the contast curve.". These seem to be different from the arguments in the command-line "sigmoidal-contrast" http://www.imagemagick.org/script/comma ... l-contrast, which asks for a contrast magnitude (0-20) and a midpoint (e.g. 50).

How do "alpha" and "beta" in the API relate to "contrast" and "midpoint" in the command-line?

thanks
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: MagickSigmoidalContrastImage

Post by anthony »

Use the source Luke... well I did anyway....

Hmmm
SigmoidalContrastImageChannel() is the function called from the Command Line API exactly as per the command docs.

MagickSigmoidalContrastImage() passes alpha and beta directly to SigmoidalContrastImageChannel(), the the same function!

As such I believe the Magick Docs are wrong (if they are as you describe).
alpha = strength of the contrast, the larger the number the more 'threshold-like' it becomes
beta = midpoint of the function as a color value 0 to QuantumRange

I have no idea where these 'shoulder' and 'toe' attributes come from.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Hilbert

Re: MagickSigmoidalContrastImage

Post by Hilbert »

Thanks Anthony/Yoda -- I suspected that the inputs were really just amount and mid-level, but I had guessed the range of the second input wrong. I now think a value of 100 corresponds to 50% in the command line sigmoidal-contrast, which doesn't seem to correspond to a QuantumRange value for some reason.
cheers!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: MagickSigmoidalContrastImage

Post by anthony »

The percentage calculation is done by the command line API, not the library. Magick API does not seem to handle the percentage aspect.

There is another function in the core library, SigmoidalContrastImage(), That is no 'Channel', which takes a string geometry argument. It does handle the percentage if present in the geometry argument. However neither CLI or Magick interfaces seem to make use of this function.

I do suggest that the function (and magick) documentation get fixed to replace the misleading 'shoulder' and 'toe' references.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Wolfgang Woehl
Posts: 34
Joined: 2010-02-25T15:22:50-07:00
Authentication code: 8675308

Re: MagickSigmoidalContrastImage

Post by Wolfgang Woehl »

Moving the center of a sigmoid function (also known as "s-curves") changes rates of both ends. Looking at an "S" makes "shoulder" and "toe" quite obvious.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: MagickSigmoidalContrastImage

Post by anthony »

Except the parameters described as effecting 'shoulder' and 'toe' are really to do with 'slope gradient' and 'slope location'. That is the problem -- documentation.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply