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

Lossless image compression #706

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Lossless image compression #706

wants to merge 1 commit into from

Conversation

Awqre
Copy link

@Awqre Awqre commented Dec 21, 2024

Lossless optimization of PDF, ICNS and ICO files and all PNG files for file size reduction

Combination of different optimizations (ECT, PNGOut, DeflOpt...)

Optimization of PNG, ICNS and ICO files

Combination of different optimizers (ECT, PNGOut, DeflOpt...)
@Et0h
Copy link
Contributor

Et0h commented Dec 27, 2024

This is an interesting effort that seems to have the most impact on the deb files:

  • Reduces raw extracted file size by around 670 KB, mostly from icons.icns (453 KB) and to a lesser extent icon.ico (77 KB) and to an even lesser extent the larger syncplay.png files.
  • Does not alter size of Syncplay-1.7.4-Setup.exe, which remains 19.5 MB
  • Shrinks Syncplay_1.7.4_Portable from 27 MB to 26.9 MB
  • Shrinks both syncplay-server.deb and syncplay.deb from 1.5 MB to 1.08 MB

I have three questions:

  1. Other than file size, is the re-encoding expected to have any positive and/or negative impact on performance?
  2. What platforms (and Python version if relevant) have you tested to ensure that these changes don't cause any compatibility issues?
  3. What commands or procedure would I need to follow if I wished to reproduce this work for new graphics? For example, which command line arguments did you use and did you use a tool to automate the process?

@Awqre
Copy link
Author

Awqre commented Dec 28, 2024

The optimizations shouldn't have any negative performance impacts. And, due to lower file size it should load faster on any system but may not be noticeable, it will almost certainly not affect memory usage either way but if it does it would be in a positive way.

The PNG optimizations are lossless and within the format specifications so they should be compatible with any standard usage on any OS. Only incompatibilities I expect would be if for some reason there's a specific requirement for an image's palette order or bit depth to remain unchanged.

I've tested on both MacOS and Windows 11, both seem to work fine but I wasn't extensive. Windows XP and older will not work with PNG ICO files. If you find any issues on Linux systems I would be interested in testing different methods for compatibility.

@Et0h
Copy link
Contributor

Et0h commented Dec 28, 2024

Thanks for the additional information. Syncplay does not officially support operating systems that have reached End of Life status from their developers (for a variety of practical reasons) and so a lack of Windows XP support is not an issue because even the extended support ended back in 2014.

@Awqre
Copy link
Author

Awqre commented Dec 28, 2024

  1. What commands or procedure would I need to follow if I wished to reproduce this work for new graphics? For example, which command line arguments did you use and did you use a tool to automate the process?

I use a collection of programs to get better compression, I'll try to list them all out later but you can get good results using a program called FileOptimizer or running ZopfliPNG and/or OxiPNG. (I'm on the train so I'll edit with links soon)

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