spillerrec / cgCompress

Efficiently store Visual Novel cgs by using a multi-image format for storing all variations of one image in one file. This way, only the differences need to be stored which reduces the file size significantly.
GNU General Public License v3.0
16 stars 1 forks source link

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

Open spillerrec opened 7 years ago

spillerrec commented 7 years ago

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