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

Reduce file size: clear code optimization #51

Open
dloebl opened this issue Apr 29, 2022 · 0 comments
Open

Reduce file size: clear code optimization #51

dloebl opened this issue Apr 29, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@dloebl
Copy link
Owner

dloebl commented Apr 29, 2022

The file size of a frame after LZW encoding could be reduced further by using so-called clear codes.
A clear code resets the LZW dictionary. Afterwards, the encoding is continued with a fresh LZW dictionary and the initial minimum code size.
As of now, cgif always issues a clear code once the dictionary is full (4096 entries). However, it can be beneficial regarding the file size to reset it earlier or later.
This is an optimization problem. We would need to find an adequate heuristic to find an approximate optimum here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant