Conversation
It came up in the discussion on GitHub PR #94 that, by default, Oxipng (the PNG encoder used by Spreet) will perform compression trials using four filters: none, sub, entropy, and bigrams. And it turns out that None (i.e. no filter) is almost always the best choice for spritesheets (where best means smallest PNG). That means there's an optimsation available to Spreet. Instead of using the defaults and letting Oxipng try all four filters, Spreet could just limit it to only using None. Benchmarking Spreet using a handful of spritesheets suggests this can speed Spreet up by 7-12% overall.
Owner
Author
|
Of the project's 16 fixtures, 12 were unchanged, three were smaller, and one was larger. I tried this out on icons from osm-bright-gl-style, openstreetmap-americana, Mapbox's basic, and whaam styles, and the ~1000 icons from openstreetmap-carto; spritesheets generated from all those remained unchanged in file size. I'm not sure why three fixtures are smaller. Running oxipng with |
Owner
Author
|
For future reference, OptiPNG's guide to PNG optimisation was useful for understanding the encoding process. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It came up in the discussion on #94 that, by default, Oxipng (the PNG encoder used by Spreet) will perform compression trials using four filters: None, Sub, Entropy, and Bigrams. And it turns out that None (i.e. no filter) is almost always the best choice for spritesheets (where best means smallest PNG output).
That means there's an optimsation available to Spreet. Instead of using the defaults and letting Oxipng try all four filters, Spreet could just limit it to only using None. Benchmarking Spreet using a handful of sprite collections suggests this can speed things up by 7-12% overall.