Page 1 of 1

transparent GIF issue

Posted: 2018-11-26T19:20:03-07:00
by slee1997
Hi Everyone.
I am trying to use Magick.NET to convert a BITMAP into a transparent GIF and below is my code:

Code: Select all

                 using (MagickImage img = new MagickImage("C:\\TEST.bmp"))
                 {
                            img.Format = MagickFormat.Gif;
                            img.Transparent(MagickColor.FromRgb(255, 255, 255));
                            img.Write("C:\\TEST.gif");
                 } 
Everything is fine but the transparent part becomes 'black' if I view the output GIF using the tool does not support 'transparency' such as MS Paint, so is it possible to turn the 'black' color into other colors?

Thanks a lot!
Regards,
Stephen

Re: transparent GIF issue

Posted: 2018-11-27T12:21:24-07:00
by dlemstra
Can you share your input file?

Re: transparent GIF issue

Posted: 2018-11-27T19:48:30-07:00
by slee1997
Hi,

I have changed my code to use 'convert' command directly and the problem is solved:

Code: Select all

convert TEST.gif -transparent "rgb(255,255,255)" -transparent-color "rgb(255,255,255)" TEST.gif
Thanks!
Stephen