Support animated gifs with a transparent background
Does the library support gifs with a transparent background? Do I have to pass any specific configuration for this to work?
Original gif example ->
GIF served by the app using imageflow-server ->
UP! I'm into the same issue here, using the version 0.8.3 (currently the latest).
UP! I'm having the same problem
Simplest step-by-step guide to reproduce:
Clone this repository and run the project ExampleMinimal, inserting the image passed into the wwwroot folder.
UP
UP! Estou com o mesmo problema
Hey everyone! I’m also having this issue with transparent GIFs. Has anyone found a temporary solution?
UP! I'm having the same problem =/
I'll look into this, perhaps it was a regression with a recent update of the gif codec. Can you confirm which versions of Imageflow Runtime (the engine, not server) that you are seeing this with?
On Mon, Nov 11, 2024, 7:16 AM Hellder @.***> wrote:
Up
— Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH5BMWASHGEWM25JB2D2ADQ77AVCNFSM6AAAAABRJCJZQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRYGY3TCMJRGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@lilith Could these be packages? I don't have them as a direct dependency, but the dlls are generated after the application is built.
We only have these two direct dependencies in the project:
Imageflow.Server Version="0.8.3"
Imageflow.Server.HybridCache Version="0.8.3"
https://www.nuget.org/packages/Imageflow.AllPlatforms/#versions-body-tab
Imageflow.AllPlatforms bundles all the Imageflow.NativeRuntime.* dependencies for you.
The versions of those packages are what matter. If you update Imageflow.AllPlatforms, does the issue persist?
@lilith yes, the issue persists.
0.13.2 is the latest, not 0.10, based on the screenshot that's a 2yo version.
@lilith I'm sorry, I sent the wrong printscreen. But the error persists.
Ok. Can you access /imageflow.debug, share that with me (email is fine), along with the exact image files that are not working for you?
Also, some browers make the backgroud white, some black, so make sure you test transparent images against something of a different color.
Any updates here?
I'm looking at a full codec swap which means reimplementing the io bridge.
BTW, animated gifs are complex and each frame mutates a canvas incrementally, and thus any processing means recomputing an optimal delta frame, palette, etc, and there are Edge Cases..
This may take a bit.
On Wed, Nov 20, 2024, 12:41 PM Henrique Holtz @.***> wrote:
Any updates here?
— Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH66WCYSNOURGPUFM6L2BTQXJAVCNFSM6AAAAABRJCJZQKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBZGQYDMMJUGQ . You are receiving this because you were mentioned.Message ID: @.***>
Animated, transparent gifs are an extremely difficult corner case. Specifically, supporting this includes:
- Decoding each frame, compositing it against the previous frames while preserving the transparency indexed color, working in indexed mode, and keeping timing and repeat information
- Doing all the normal image processing such as resizing, sharpening, effects
- Re-quantizing the result while finding a reasonable compromise for transparent pixels, since GIF does not support partial transparency, only opaque or invisible. Palette magic must ensure that there is overlap with the global and prior frame palettes to keep the transparent index consistent.
- Since there's no way to mark a pixel as transparent on a frame, only relative to previous frames, to preserve transparency all prior frames must have the same pixel marked as transparent
- Diff the current frame and prior frame and crop to the area that is actually different, positioning that rectangle and providing just that area. Re-encoding and attempting to avoid palette bloat, but also not eliminating colors unique to the frame. Doing this optimally is a massive task, even more so if you try to achieve true-color hacking (at the expensive of massive file size).
- Encode and compress
I'm estimating the entire encoding pipeline would need to become quite a bit slower to account for this, possibly making real-time difficult. After a few days of working on this, I'm going to put this on the backlog, and suggest that animated AND transparent gifs be an offline task, and consider gifski.
Transparency works fine if it's not animated
On Tue, Dec 3, 2024, 5:40 PM Marcos Eckart @.***> wrote:
Does the library support gifs with a transparent background? Do I have to pass any specific configuration for this to work?
— Reply to this email directly, view it on GitHub https://github.com/imazen/imageflow/issues/653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2LH6LAAZCRYEFFVD35Y32DZFOLAVCNFSM6AAAAABS66M4JGVHI2DSMVQWIX3LMV43ASLTON2WKOZSG4YTMMRYHE4TGOI . You are receiving this because you were mentioned.Message ID: @.***>
Okay, got it. Is there any simple way to ignore .gif files in the imageflow middleware? And process this file in another way, without going through the lib?