-
-
Notifications
You must be signed in to change notification settings - Fork 852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error block in image result after saving after loading some files #2866
Comments
What do you mean by compressed gifs? The encoder only encodes the difference because otherwise you end up with massive gifs. There’s no way to turn that off. |
Sorry for the long delay in replying.
I'm referring to gifs that only keep a record of the changed pixels. After I ran a lot of tests, I figured out why I was asking the question. Using CloneFrame itself gives me the results I want, and the reason I'm asking is because I usually save as a png or gif, so it's getting the wrong results, and leading me to think that what this method gets would be the difference pixel map (instead of the full frame image) This gif if I export it using CloneFrame and save it as a png, it will all show up as a pure empty image. using var image = await Image.LoadAsync<Rgba32>("1.gif");
for (var i = 0; i < image.Frames.Count; i++)
{
using var frameImage = image.Frames.CloneFrame(i);
frameImage.Save($"frame-{i}.png");
} And if I store it in jpg format, it's correct, this image is the result I want. using var image = await Image.LoadAsync<Rgba32>("1.gif");
for (var i = 0; i < image.Frames.Count; i++)
{
using var frameImage = image.Frames.CloneFrame(i);
frameImage.Save($"frame-{i}.jpg");
} |
A similar phenomenon occurs in webp. For example, these two images. using var image = await Image.LoadAsync<Rgba32>("1.webp");
await image.SaveAsync("2.webp"); I changed the title of the issue because of this. |
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
3.1.6
Other ImageSharp packages and versions
SixLabors.ImageSharp.Drawing 2.1.5
Environment (Operating system, version and so on)
macOS Sequoia 15.2
.NET Framework version
.net 9.0
Description
There are some specific compressed Gif files that are saved after being loaded that lose their differential rendering properties, resulting in black blocks in the image. But the original image renders fine without ImageSharp. However the image works fine in ImageSharp after it has been re-encoded by other software.
The result of the error looks like this:
As well, how do I get the full frame image of the compressed Gif correctly in the code instead of the difference?
Steps to Reproduce
just load and save it.
Images
The text was updated successfully, but these errors were encountered: