[Solved]Sigmoidal contrast args problem

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
markmarques
Posts: 88
Joined: 2010-06-29T14:36:09-07:00
Authentication code: 8675308

[Solved]Sigmoidal contrast args problem

Post by markmarques »

Hi,
recently I was experimenting some tricks with Imagemagick and stumbled with the
-sigmoidal-contrast function....

None the less in the "usage" docs it appears called with
"-sigmoidal-contrast value1 , value2 % "
In the "Main documentation doc" it shows up as
"-sigmoidal-contrast value x value2 %"
....

After some tests I do not see any difference in the result images by calling one or the other ...
Or am I wrong ?

In the "Main Documentation doc" also state that it is possible to change the "brightness" with this function ...
But the example is not correct or understable enough ...
To achieve the equivalent of a sigmoidal brightness change, use -sigmoidal-contrast brightnessx0% to increase brightness and class="arg">+sigmoidal-contrast brightnessx0% to decrease brightness.
What is supposed to be included in the command line to change the brightness tru the sigmoidal-contrast function ?

Thanks in advance
Last edited by markmarques on 2012-09-05T23:22:26-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Sigmoidal contrast args problem

Post by fmw42 »

There is no brightness control in sigmoidal-contrast? It is just a non-linear contrast. Though you may get some effect by shifting the second argument from 50. The better solution is my script sigmoidal. It does this is two steps. On used second argument of 50% for contrast and the other uses second argument of 0% for brightness. See my script below for more details. This was an attempt to reproduce the newer brightness contrast function in Photoshop.

P.S. It does not matter if the separator between the two arguments is a comma or an x. That is the case with most two argument IM functions as I understand it.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Sigmoidal contrast args problem

Post by anthony »

Note that the values should have not spaces just the comma between them, or put in quotes (that is a single argument must follow -sigmoidal-contrast )
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
markmarques
Posts: 88
Joined: 2010-06-29T14:36:09-07:00
Authentication code: 8675308

Re: [Solved]Sigmoidal contrast args problem

Post by markmarques »

Thanks for the fast reply.

In a nutshell: the function works the same way both with "," and "x" ...
the possibility of changing the brightness is tru the second argument.

PS . I only showed the "spaces" in the example values for better compreension in post... :)

Thanks again for the fast reply ...
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: [Solved]Sigmoidal contrast args problem

Post by anthony »

Which is why ',' is probably a better choice.

The use of 'x' is more for geometry arguments when dealing with rectangular regions, where it makes things clearer.
The same goes for arguments with a 3rd or 4th number (geometry uses a + or - prefix)
EG: 1x2+3-4 is the same as 1,2,3,-4

One of the recent changes was to allow the ability to use multiple signs for the numbers:
EG: +-4 in the above will also work just fine.
This means you can have a variable (shell, or in IMv7 a percent escape) containing either a positive "4" or a negative "-4", and then insert (string substitute) it into the argument, for example "${W}x${H}+${X}+${Y}", without 'sign' problems. Of course using commas which not have ad problems either, for example "$W,$H,$X,$Y"

Any number of signs can be used, each '-' negating the final number between negative and positive.

The last example using percent escapes in IMv7 (operator arguments only at this point) would have been something like... "%[my:W]x%[my:H]+%[my:X]+%[my:Y]"
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply