Page 1 of 1

[Solved]Sigmoidal contrast args problem

Posted: 2012-09-05T02:50:16-07:00
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

Re: Sigmoidal contrast args problem

Posted: 2012-09-05T14:02:09-07:00
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.

Re: Sigmoidal contrast args problem

Posted: 2012-09-05T22:43:39-07:00
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 )

Re: [Solved]Sigmoidal contrast args problem

Posted: 2012-09-05T23:25:26-07:00
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 ...

Re: [Solved]Sigmoidal contrast args problem

Posted: 2012-09-06T16:36:52-07:00
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]"