Skip to content
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

Possibility/plans to write GIFs with an alpha layer ? #48

Closed
Zulko opened this issue Dec 12, 2014 · 5 comments
Closed

Possibility/plans to write GIFs with an alpha layer ? #48

Zulko opened this issue Dec 12, 2014 · 5 comments

Comments

@Zulko
Copy link
Contributor

Zulko commented Dec 12, 2014

I have seen in the docs that it is not possible right now, and I played a little bit with it but it is still unclear to me if it is a limitation of freeimage, or just not implemented yet.

@almarklein
Copy link
Member

Looked into it again, and it seems to be a limitation of freeimage; the quantize functions only accepts 24bit images.

From the looks of it, it would not be possible to provide a full range of alpha values. However, the following may be a feasible workaround:

  • in Python, map all pixels for which alpha < 50% to a specific color (preferably a color that is far away from any other color in the image)
  • Turn the image to RGB (by discarding the alpha channel)
  • Quantize this 24 bit image
  • Set the specific color to be fully transparent.

@almarklein
Copy link
Member

We should try again with Pillows gif writer.

@almarklein
Copy link
Member

I tried with Pillow, but it keeps producing RGB palettes instead of RGBA. I spend more time on than this ancient format is worth :) So from my end this is a wontfix. (Though I am open for PR's that address this issue.)

@almarklein
Copy link
Member

Maybe via #220

@FirefoxMetzger
Copy link
Contributor

Closed in favor of #360 .

The original question for free-image, which doesn't support alpha/transparency in GIF, this issue has been identified as a won't fix. If there is a particular need to support transparent GIF via free-image, please create a new issue that can be titled and tagged appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants