in reply to batch rgb brightness and contrast adjustment
edada wrote:
Hi, I had some problems changing brightness with Imager using your code :
In Imager::Filters doc I can read that the contrast filter "scales each channel by intensity. Values of intensity < 1 will reduce the contrast". Your map do the same if $r => $b => $g ! It's supposed to change brightness and not contrast. I simply recommand you writing it with a :my @redmap = map { int( $r * $_) } 0..255; my @greenmap = map { int( $g * $_) } 0..255; my @bluemap = map { int( $b * $_) } 0..255; [..] $newimg->map( red=>\@redmap, green=>\@greenmap, blue=>\@bluemap ); $newimg->filter(type=>'contrast', intensity=> $c);
and using null value as default value.my @redmap = map { int( $r + $_) } 0..255;
|
|---|