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

Base image could be a combination of all the images #8

Open
spillerrec opened this issue May 28, 2017 · 0 comments
Open

Base image could be a combination of all the images #8

spillerrec opened this issue May 28, 2017 · 0 comments

Comments

@spillerrec
Copy link
Owner

It is most commonly noticed with eyebrows:
0 1
The eyebrow moves, and the overlay image contains both erases the old eyebrow and paints the new one. Total size: 33,454 bytes

An alternative way would be to use a base image which contains no eyebrows, and two overlays just adding the eyebrows:
shared-base shared-1-cropped shared-2-cropped
Total size: 33,046 bytes

Since the base image is simpler now, it got reduced with 458 bytes (from 30,068 bytes).
The two diff images are however larger by 50 bytes, but this can be removed by storing them in the same image like this:
shared-combined2
It is now smaller with 64 bytes, thus smaller than the original diff image as well. Worth doing this for 64 bytes? Probably not, but something to think about nevertheless.

Current Proposed Shared context
Base 30,068 29,610 29,610
Diff 1 1,572
Diff 2 3,386 1,864 3,372
Total 33,454 33,046 32,982
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

1 participant