[magick-users] transform intervals of gray values to transparent

Günter Bachelier guba at VI-ANEC.de
Fri Mar 28 07:45:40 PDT 2008


Hello,

I have gray images and I want to transform intervals
of gray values to transparent with PerlMagick, lets say
[rgb: 0 0 0 0 ... rgb: 45 45 45 0]. I have tried it with

for ($j = 0; $j <= 45; $j++) {
    $rgb_gray = 'rgb:' . ' ' . $j . ' ' . $j . ' ' . $j . ' ' . '0';
    $image->Transparent(colors=>"$rgb_gray");
};

but it seems that only 0 0 0 0 will be transformed to
transparent (even if I choose an interval where
black is not included). How can this task be done?
Thank you!


Guenter


More information about the Magick-users mailing list