"Marcel Wouterse" on  wrote...
| What i am actually trying to do is add transparency to an animated gif:
| 
| This is the original: 
| http://www.online-image-editor.nl/examples/trans_original.gif
| (has a white background)
| 
| This is my result after I make white the transparent color:
| http://www.online-image-editor.nl/examples/trans_bad.gif
| 
| And this is how it should be, but I don't know how to get this with IM:
| http://www.online-image-editor.nl/examples/trans_good.gif
| 
| Anybody know the difference between the "bad" and the "good" version?
| 
The problem, is two fold.
 1/ Because your GIF image now contains transparency, the GIF dispose
    methods will need to be modified to correctly handle the clearing
    of the transparency.

    The simplist way would be to -coalesce your image first,  then use a  
        -fill none  -draw 'color 0,0 floodfill'
    options to clear the area areound the transparency.

    Now if you have the latest IM version you can now use
      -layers Optimize
    to optimize your animation and set the appropriate dispose method
    so the animation works as defined by its  coalesced  form.

    For full details see
       http://www.cit.gu.edu.au/~anthony/graphics/imagick6/anim_basics/

 2/ The other problem is the shadow outline, and other white edges.
    This is because the animation was overlayed onto a white background
    before shrinking to allow the image to be correctly anti-aliased.

    Unfortunatally while GIF can anti-alias an edge to a color, it can
    not do so to a transparency as transparency is purely an on/off
    relationship in the format.

    Solutions for this is basically to try and overlay the original
    transparent image onto a color simular to the background color of
    the page you are planing to use it on.

    This becomes a particular problem when deailing with shadows which
    were generally originally created using a semi-transparent black.

    See
       http://www.cit.gu.edu.au/~anthony/graphics/imagick6/formats/#trans
    for more information and techniques.

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
   Zatherus warn Zartheris! But, arh, Zatheris never listens to Zatherus!
                                             -- Babylon 5
 -----------------------------------------------------------------------------
     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