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

Losslessly optimise file size of mod assets #1140

Draft
wants to merge 5 commits into
base: 1.12-runes
Choose a base branch
from

Conversation

NeRdTheNed
Copy link

@NeRdTheNed NeRdTheNed commented Dec 14, 2020

TODO:

  • .ogg files - currently trying to revive Segher Boessenkool's ReHuff program, need to implement more Vorbis parsing options.
  • .json files? (haven't investigated yet :P)

Optimised, not yet properly tested and verified:

  • Losslessly reduced file size of all .png files:
    This was achieved through using “Papa’s Best Optimizer” (which can be downloaded from https://papas-best.com/optimizer_en) with “Optimise compression”, “Delete metadata" and “Clear transparent (premultiplied) pixels” selected, as well as "ImageOptim" (which can be downloaded from https://github.com/ImageOptim/ImageOptim), with only lossless optimisations enabled, and all .png tools enabled. I’m fairly certain that some of the optimised files have issues which need to be manually corrected, so I’ll probably do that in the next commit.

Note: As I've modified a large amount of files, I have not been able to verify that they are all exactly the same as before, which is why this is a draft PR. Once I’m satisfied with the level of optimisation across all assets, I will work through providing an easy way to verify that all content is the same.

This was achieved through using “Papa’s Best Optimizer” (which can be downloaded from https://papas-best.com/optimizer_en) with “Optimise compression”, “Delete metadata‘ and “Clear transparent (premultiplied) pixels” selected. To the best of my knowledge, Papa’s Best Optimizer performs only lossless .png optimisations, and using ImageMagick’s compare functionality seemed to confirm this in the samples I tested.
@NeRdTheNed
Copy link
Author

(I think the build failing isn’t my fault, it looks like CurseMaven is down.)

@GoryMoon
Copy link
Contributor

You should rebase on the branch again as the cursemaven thing have been fixed

These file size reductions came from using the program "ImageOptim" (https://github.com/ImageOptim/ImageOptim), with only lossless optimisations enabled, and all .png tools enabled. These files were additionally optimised further by then running the results through “Papa’s Best Optimizer” again (used in the previous commit), and continuing to cycle between the two programs until no further improvements were made.
The command "git merge --strategy-option theirs upstream/1.12-dev" was used to apply any changes to .png files from the upstream repository to this branch when merging.
The same process used to optimise the previous files was used again for the new and updated files. I’m fairly certain that some of the optimised files have issues which need to be manually corrected, so I’ll probably do that in the next commit.
FileOptimizer can be found at this (https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer) address. FileOptimizer claims to only perform lossless optimizations, but I’ll work on verifying that no quality reduction has occurred in any files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants