PngBitDepth.Bit8 not work, image still bit32 #1480
-
This is my code: using(SixLabors.ImageSharp.Image image = SixLabors.ImageSharp.Image.Load(@"E:\c#\WindowsFormsApp1\bin\Debug\test.png")) {
SixLabors.ImageSharp.Formats.Png.PngEncoder pngEncoder = new SixLabors.ImageSharp.Formats.Png.PngEncoder();
pngEncoder.CompressionLevel = SixLabors.ImageSharp.Formats.Png.PngCompressionLevel.Level5;
pngEncoder.BitDepth = SixLabors.ImageSharp.Formats.Png.PngBitDepth.Bit8;
image.SaveAsPng("test2.png", pngEncoder);
} |
Beta Was this translation helpful? Give feedback.
Answered by
JimBobSquarePants
Dec 18, 2020
Replies: 1 comment
-
This issue would have been better suited as a QA discussion and as such I've transferred it. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JimBobSquarePants
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PngBitDepth
is calculated at bits per sample or per palette index (not per pixel). This is inline with the specification. To set your colorspace you also need to set thePngColorType
property.This issue would have been better suited as a QA discussion and as such I've transferred it.