Closed brianpopow closed 6 months ago
webpinfo:
RIFF HEADER:
File size: 74554
Chunk VP8X at offset 12, length 18
ICCP: 0
Alpha: 1
EXIF: 1
XMP: 0
Animation: 0
Canvas size 480 x 480
Chunk VP8L at offset 30, length 74330
Width: 480
Height: 480
Alpha: 1
Animation: 0
Format: Lossless (2)
Chunk EXIF at offset 74360, length 194
No error detected.
This is not a bug? The image is being written as a jpeg file that has no support for an alpha channel. When this happens the alpha channel is removed and the rgb channels behind it are "revealed". The user should use a method that replaces the alpha channel with a solid color before saving the image?
@dlemstra yes you are right, it is not actually a bug in the decoder. Using a format which supports transparency or applying image.Mutate(x => { x.BackgroundColor(Color.Black); });
fixes the issue:
I was jumping to fast to a conclusion.
@dlemstra Thank You, (shouldn't it default to white for transparent pixels ? ; like in mspaint when you save a transparent png as jpg)
No. We should never make assumptions that are destructive to incoming data.
Discussed in https://github.com/SixLabors/ImageSharp/discussions/2659