simoidalContrast: unrecognized 'mid-point'

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Until we get a patch in the current ImageMagick release, use
  • image->SigmoidalContrast( "3x50" );
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

Re: simoidalContrast: unrecognized 'mid-point'

Post by tcrass »

Hi threre,
Until we get a patch in the current ImageMagick release, use

image->SigmoidalContrast( "3x50" );
it seems that currently neither this method, nor the parameters described in the PerlMagic documentation work as they should. At least for me, the following bit of code

Code: Select all

my $img = Image::Magick->new();
$img->Set(size => '160x120');
$img->Read('gradient:#ffffff-#000000');

push(@$img, $img->[0]->Clone());
$img->[1]->SigmoidalContrast(contrast => 3, 'mid-point' => 10);

push(@$img, $img->[0]->Clone());
$img->[2]->SigmoidalContrast(contrast => 3, 'mid-point' => 90);

push(@$img, $img->[0]->Clone());
$img->[3]->SigmoidalContrast(contrast => 3, 'mid-point' => 0.1);

push(@$img, $img->[0]->Clone());
$img->[4]->SigmoidalContrast(contrast => 3, 'mid-point' => 0.9);

push(@$img, $img->[0]->Clone());
$img->[5]->SigmoidalContrast('3x10');

push(@$img, $img->[0]->Clone());
$img->[6]->SigmoidalContrast('3x90');

$img->Montage()->Write('sigmoidalContrast.png');
creates a bunch of virtually indistinguishable images, demonstrating that the mid-point option has no effect. (Or am I missing something?)

Regards --

tcrass

P.S. Using perlmagick from an up-to-date Debian Sid installation.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: simoidalContrast: unrecognized 'mid-point'

Post by magick »

Use '3x50%' or use an absolute value that scales to the quantum-depth of your ImageMagick distribution. Most likely its Q16 so use 59000 instead of 90.
tcrass
Posts: 38
Joined: 2009-11-22T11:12:52-07:00
Authentication code: 8675309

Re: simoidalContrast: unrecognized 'mid-point'

Post by tcrass »

magick wrote:Use '3x50%' or use an absolute value that scales to the quantum-depth of your ImageMagick distribution. Most likely its Q16 so use 59000 instead of 90.
That works, thanks a lot! :-)

The original posting is from 2006 -- any chance that either PerlMagick or the documentation gets updated?

Regards --

tcrass
Post Reply