Anthony Thyssen on  wrote...
| "Bryan Byrne" on  wrote...
| | Hi there,
| |
| | I'm trying to apply transparency to a range of colors within a file. I'm
| | starting with a JPEG and writing it to GIF. My current command is:
| |
| | convert test_JPEG.jpg -transparent "#c1c1c1" test_GIF.gif
| |
| | Unfortunately  I need to apply the transparency to a wider range of colors
| | than just "#c1c1c1". Is there anyway for me to specify "#c1c1c1" and any
| | colors within a certain range?
| |
| 
| To make a color transparent in GIF, just make it transparent in the
| image that is in memory..
| 
| EG:  for an exact color  use
| 
|      -matte -fill none -opaque "#c1c1c1"
|                        -opaque "red"
|                        -opaque "blue"
|
My mistake, on further testing the current IM treats -transparent as
just a color operator than is equivelent to the above use of -opaque.

In other word you should be able to just use -transparent multiple
times, after giving the image a matte channel.  It is only used as

      -matte  -transparent "#c1c1c1"
              -transparent "red"
              -transparent "blue"

It currently does not set the actual color used for the GIF transprant
color index, EXCEPT in the special case that no 'matte' or 'alpha'
channel is present in the output image.

As your original image did not have a 'matte' channel, only the last
-transparent setting was able to be applied.


I have reported this problem on the IM known bugs page...
  http://www.cit.gu.edu.au/~anthony/graphics/imagick6/bugs/testing/
And presented a solution that will also allow the use of the same
color value (different color table index) for both the GIF images
transparent color, and its use as an actual color.

That is the proposed solution will allow you set a fully-transparent
white color, for the GIF background, while still allowing you to use a
fully-opatue white in the image itself.


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
    This was a fatal mistake for the Kzinti, ...  the reason humanity had
    decided to study war no more, was that humans were so very, very good
    at it!                         -- "Man-Kzin Wars IV" --  Larry Niven
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to