WEBP Image Stored 100x Larger Than it Ought to Be Due to Funky Original Image? #2707
Answered
by
brianpopow
Nicholas-Westby
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
brianpopow
Mar 28, 2024
Replies: 1 comment 2 replies
-
This code seems to work around the issue: using var imageData = Image.Load<Rgb24>(originalPath);
var width = imageData.Width;
var height = imageData.Height;
var pixels = new Rgb24[width * height];
imageData.CopyPixelDataTo(pixels);
using var newImage = Image.LoadPixelData<Rgb24>(pixels, width, height);
newImage.SaveAsWebp(newPath, new WebpEncoder
{
SkipMetadata = true,
Quality = 60,
Method = WebpEncodingMethod.Level6,
UseAlphaCompression = false,
TransparentColorMode = WebpTransparentColorMode.Clear,
NearLossless = false,
NearLosslessQuality = 0,
FileFormat = WebpFileFormatType.Lossy,
EntropyPasses = 10,
}); I'm just loading up a pixel buffer and then storing that as an image. I figured this way it won't keep whatever cruft is being carried along with the original image otherwise. Still curious why the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a very large color profile embedded in the image:
webpinfo shows this:
Note the Chunk ICCP at offset 30, length 557176