Transparency error when converting a png to bmp
张铎 <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <CAAAYAnP61HkSma3th1jJ=3yq_iREFvjw574GQ+Z2=VcxnFaOyg@mail.gmail.com> |
When converting a png icon with transparent background to bmp, I got a image with black background and the actual icon became transparent... You can download this image http://www.iconarchive.com/show/I-like-buttons-3a-icons-by-mazenl77/Cute-Ball-Go-icon.html, and run gm convert Cute-Ball-Go-icon.png c.bmp with gm 1.3.21 and check the result bmp. I found that bug #271 fix a problem which cause a blank result when converting bmp to jpg. The fix reverse the opacity of a pixel in bmp decoder. So I tried to also reverse the opacity of a pixel in bmp encoder. Modify coders/bmp.c, change line 1736 from *q++=ScaleQuantumToChar(p->opacity); to *q++=MaxRGB-ScaleQuantumToChar(p->opacity); It fix my problem but I'm not sure whether it is the right approach. Thanks. ------------------------------------------------------------------------------ _______________________________________________ Graphicsmagick-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help