Re: Transparency error when converting a png to bmp
Bob Friesenhahn <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 17 Aug 2015, 张铎 wrote:
>
> 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.
This is likely a more appropriate fix:
if (bmp_info.bits_per_pixel == 32)
*q++==ScaleQuantumToChar(MaxRGB-p->opacity);
since otherwise there will be a problem for anything but the Q8 build.
The alpha channel is inverted in GraphicsMagick from the way it is
stored in most file formats.
Bob
--
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
------------------------------------------------------------------------------
_______________________________________________
Graphicsmagick-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help