| >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! | Fred Weinhaus on wrote... | I am not sure I understand what you are trying to do. But process | your grayscale image without transparency to the form you want, then | add that processed image to your original as the alpha channel. | | See copyopacity | | http://www.imagemagick.org/Usage/compose/#copyopacity |
It may also be that you need to use rgba: rather than rgb: Sorry for the delay, I have been on vacation in china for 5 weeks. However if the image is already a greyscale image (not just data) then it is probably faster to do it within IM as Fred described. If you just have a pure text data file, then there are methods to convert it to a greyscale image using say a PbmPlus type of image file format. That format has a minimal text header followed by either binary or text numbers. The image can be bitmap, greyscale or RGB, though not RGBA. You say its grey scle, so a PGM image format may be best, then you can use Im to convert that into transparency masks. Anthony Thyssen ( System Programmer ) <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- VI? Bless you my son, for thee have acquired expertise in the One Sacred Editor. Never mention The Enemy, lest it break out into text mode on other holy consoles. ----------------------------------------------------------------------------- Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/ _______________________________________________ Magick-users mailing list Magick-users@imagemagick.org http://studio.imagemagick.org/mailman/listinfo/magick-users