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

Optimize assets. #135

Closed
wants to merge 1 commit into from
Closed

Optimize assets. #135

wants to merge 1 commit into from

Conversation

K0-RR
Copy link

@K0-RR K0-RR commented Aug 1, 2021

Lossless compression.

@ghost
Copy link

ghost commented Aug 7, 2021

What exactly is this doing to the assets can you give me like a weighing of the pros and cons and a more in-depth understanding of what's happening here?

@K0-RR
Copy link
Author

K0-RR commented Aug 13, 2021

I used oxipng for this EDIT -corrected the command oxipng -arvZt8 -o max --strip all --fix.

  • pros
    smaller jar size.
  • cons
    I don't see any.

more in-depth understanding of what's happening here

Link to the tool repo - https://github.com/shssoichiro/oxipng. Here is a part of a log from my other optimization:

Processing: /home/username/Documents/GitHub/REPO/src/main/resources/assets/modid/textures/item/file.png
    16x16 pixels, PNG format
    4x8 bits/pixel, RGBA
    IDAT size = 463 bytes
    File size = 2279 bytes
Reducing image to 8 bits/pixel, 95 colors in palette
Trying: 6 combinations
Found better combination:
    zc = 0  zs = 0  f = 0        126 bytes
    IDAT size = 126 bytes (337 bytes decrease)
    file size = 514 bytes (1765 bytes = 77.45% decrease)

This does not reduce the quality of the files, only the size. You can use this Github bot http://imgbot.net/ to achieve similar results to mine (tbh the results are worse but the bot does not require any knowledge or manual to use, it just opens ready-to-merge prs).

ghost pushed a commit that referenced this pull request Aug 13, 2021
@ghost ghost closed this Aug 13, 2021
@K0-RR
Copy link
Author

K0-RR commented Aug 13, 2021

I also opened PRs in Your other mods. Feel free to do the compression by yourself.
TerraformersMC/Campanion#147
TerraformersMC/Traverse#74
TerraformersMC/Terrestria#259

I changed the tool/command recently to get better results so I updated it here above in case someone wants it.

This pull request was closed.
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.

1 participant