Optimized GIFs that use a color palette combined with transparency over a colored
background when decoded will have the background color ignored. causing the formerly
transparent pixels to be black once decoded.
What does 'go version' print?
Verified against 1.2.1, 1.2.2, 1.3beta1
What steps reproduce the problem?
Decoding optimized gif with transparency over colored background.
If possible, include a link to a program on play.golang.org.
Original Image: http://i.imgur.com/nGsYOhn.gif
1. gif.DecodeAll, then gif.EncodeAll out new file. The frames will have black pixels
replaced where transparency should of been.
- http://play.golang.org/p/z8VwdM7jfS
- Resulting image: http://i.imgur.com/59gSWgw.gif
2. gif.Decode, then jpeg.Encode out new file. The single frame that is encoded will have
black pixels where the transparency should of been.
- http://play.golang.org/p/WPvkNmpiw4
- Resulting image: http://i.imgur.com/ZSxA5nO.jpeg
What happened?
Transparency replaced with black pixels
What should have happened instead?
transparency over colored background should be maintained.
Please provide any additional information below.
Attachments:
- original.gif (1298657 bytes)
- AfterDecodeAll-EncodeAll.gif (1316042 bytes)
- AftergifDecode-jpegEncode.jpeg (14923 bytes)
Attachments: