FLIF-hub / FLIF

Free Lossless Image Format
Other
3.72k stars 229 forks source link

Loss data when compress transparent PNG. #500

Closed korenkonder closed 6 years ago

korenkonder commented 6 years ago

The problem is that FLIF ignores the color information if the transparency is zero. This is a problem, because I need the original color information even where the transparency is zero. So I think this is a problem, because FLIF loses this data when compressed. Of course there is an option to store separately the Alpha channel and RGB, but these are crutches.

1.png - Screenshot of channels in img01_calculated_final.png. 2.png - Screenshot of channels in img01_calculated_final.flif.png.

1 2

img01_calculated_final img01_calculated_final flif

weltkante commented 6 years ago

FLIF has an option flif_encoder_set_alpha_zero_lossless for turning off this optimization if you are going to use the alpha channel for something else than the standard blending formula. If you aren't coding directly against the library but using a tool it probably has a switch for that (if not thats a bug in the tool).

(Note I'm just another user of FLIF and not a developer of the library)

korenkonder commented 6 years ago

Oh. I see. This is option -K. I just don't understand for what it needs. Issue closed.

martin-varela commented 6 years ago

I think you might have forgotten to close the issue.