Commit graph

4 commits

Author SHA1 Message Date
Elvish_Hunter
e58589e4ce woptipng: ignore thread niceness on Windows
Fixes #7457.
2023-03-17 23:30:39 +01:00
Eric Gallager
3344241e6a Update woptipng.py
add encoding comment
see: https://peps.python.org/pep-0263/
2022-05-06 19:10:58 +02:00
Steve Cotton
e7e3ae76d8 Refactor the woptipng script
If a tool made the image bigger, the debug message was the same as if the tool
had made the image's pixel change. Clarify that into two separate messages.

As each verify_images() call checks that the file became smaller, the removed
print statement would never be reached.
2021-05-12 16:04:32 +02:00
Matthias Krüger
b3fe980d70 add woptipng png compression script
An improved version of the wesnoth-optipng shell script.

Supports multiple jobs at a time. ( -j )
Accepts a threshold for discarding images which were only reduced by a few bytes. ( -t 15 will only save images that were reduced in size by at least 15 %).
Niceness can be set using the -n switch.

Usage:
cd <directory>
woptipng . ../some/dir  ../some/some_file.png

The script should achive better compression ratios than the previous script.
The previous script was running optimizations in an unconditional loop and, at the end, did not save the image if pixel colors changed.
This implies if *one* of the crushers did a bad job and changed the images content in a bad way, *none* of the possibly good optimizations by the other crushed would be saved.
Woptipng checks the image every time after a crusher touched it and only reverts a single optimization if it was bad leaving possibility for the other tools to still perform a good job and reduce size of the image.
2016-12-22 15:27:43 +01:00