Python wrapper for oxipng, a multithreaded PNG optimizer. Version 9.1.1 supports Python >=3.8 and is actively maintained. Releases follow oxipng upstream closely, typically every few months.
pip install pyoxipngNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Read a PNG from file, optimize it in memory, and save the result.
Open the file in binary read mode and pass bytes.
Update code from `result, changed = optimize_png(data)` to `result = optimize_png(data)`. Use `if result != data:` to check if optimized.
Replace `optimize_png(data, level=6)` with `optimize_png(data, opts=dict(level=6))`.