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

Gif export seems to only export colors in the current palette #73

Open
rosemash opened this issue May 2, 2020 · 1 comment
Open

Gif export seems to only export colors in the current palette #73

rosemash opened this issue May 2, 2020 · 1 comment
Labels
type:enhancement New feature or request

Comments

@rosemash
Copy link

rosemash commented May 2, 2020

Issue: When exporting as a gif, it seems that colors which aren't part of the palette end up not being in the final gif. Those pixels end up transparent or simply the wrong color.

How to reproduce: Open a png file with rx file.png where file.png is an image containing colors that aren't in the starting palette. Split into multiple frames, then export as a gif. Switch to a palette with the required colors, then export as a second gif. The first gif has missing colors, but the second gif is correct.

@cloudhead
Copy link
Owner

Yeah I'm aware of this behavior. It's tricky to get this exactly right, as gifs have a maximum of 256 colors, while pngs can old millions. In the master branch, there is a command p/sample to load the view colors into the palette. You could run this command before exporting to gif.

I think one potential long term solution is to scan the view buffer for all colors and add them to the gif palette. If there are more than 256, we can throw an error and refuse to export.

@cloudhead cloudhead added the type:enhancement New feature or request label May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants