-
Notifications
You must be signed in to change notification settings - Fork 124
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
Image compresses better with duplicate entries kept in palette #553
Comments
Hi @Rainboom-Dash, thanks for posting this. @ace-dent Do you know anything about deliberate duplicates in a palette like this? I'm pretty sure optipng wouldn't do that. |
@Rainboom-Dash - very interesting file. Where did it come from and do you know what software produced it? The pngthermal image shows the surprisingly very low entropy achieved across the whole image... |
I downloaded from https://derpibooru.org/images/3198446 which was taken from https://www.deviantart.com/boxwari/art/Flurry-Musicante-981750954 which I just now realized I probably should of downloaded from Deviantart just to get closer to the source It does seem like --np gets a few percent better compression here |
FWICT, this is 2 separate issues now:
Did I misunderstand? Also, does the observation of the duplicate palette entries corresponding to allowing better compression make sense, or is that a potential correlation/causation error? |
@andrews05 - I wonder if the edge preference heuristic I suggested, is failing here...? |
@ace-dent The target IDAT size is 47918, as achieved with I took a quick look at the GLDPNG source. It's definitely not an optimiser or doing anything interesting with the palette, so either something else is responsible for this or it's just accidental (entirely possible). @TPS The structure/order of palette can have a big impact on line filtering. It's not unthinkable that some weird optimisation might be achieved by spreading out the colours like this, it's just not something I've seen or considered before. Nor can I imagine how one might implement such a strategy. @Rainboom-Dash Would you be able to post a couple more samples that have regressed like this? |
@andrews05 Since @ace-dent has found tools that solve this sensibly (optimized reduced pallette & IDAT), IMHO, not worth pursuing this weird "ordering," but rather, whatever those tools are doing. |
@andrews05 I believe the other losses are due to libdeflate and it's usually around 0.1% file size increase or less... and usually it has decreased file size not increased... it's just sometimes it increases... but yeah, it's pretty small and I think that will just happen when the algorithm changes.. |
@Rainboom-Dash Good to know. This one remains a unique mystery then. I've just posted a PR to resolve this by keeping the original palette, same as it did in v8. But I think we should keep the issue open for further investigation. |
@andrews05 Per @ace-dent's note above, this title change doesn't represent the current best for this image, just the weird quirky original? So maybe analyze the intermediate & try to meet/beat that? 🙇🏾♂️ @ace-dent It'd probably really help if you'd post what toolchain you used to get your result. 🙇🏾♂️ |
@ace-dent Did you post the correct version of the image? |
I've replaced a few tests with synthetic images and removed a number that I don't believe are relevant anymore. I've also removed the #553 test without replacement as I don't know how to synthesise a replacement and the issue is still open anyway. Going forward I think we should avoid adding any new "issue" tests and instead synthesise something suitable in one of the other collections. Closes #655.
I'm getting increased file sizes with the latest commits that I built on Sept 4th versus the latest stable release
I've tested the default libdeflate compression and zopfli and both are increasing file size considerably
This is not the only image that is getting increased file sizes but it is one of the more significant ones that has a few percent increase (maybe because the file size is smaller to begin with)
On average it seems the latest commits decrease file size slightly... but there are some regressions
I thought maybe it was just the libdeflate since the version was changed but it seems zopfli is affected as well...
The image I tested with has had optipng run on it (the site I downloaded from automatically does that)
The text was updated successfully, but these errors were encountered: