-
png is the de-facto standard Rust crate for reading and writing PNG images, used e.g. by the image crate.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
Encoding images to PNG with the "fast" compression mode is now an order of magnitude faster. This is achieved using a custom Zlib compression implementation that leverages assumptions about the patterns in PNG data to get reasonable compression ratios at phenomenal speeds.
-
For example, when converting vector SVG images to raster PNG images with resvg, most of the time is spent compressing the PNG image. This is a lot of wasted work if we just want to read the image instead of transferring it over the network! The fast compression mode eliminates all this wasted work, resulting in huge performance and efficiency gains.
-
The changes have been tested for regressions on 80,000 images, and the new Zlib implementation has been roundtrip-fuzzed to ensure correctness. The png crate as a whole also added roundtrip fuzzing. So we're quite confident in the correctness of these changes, but if you find anything amiss, please open an issue on Github.
-
When the QOI format was first announced it wasn't clear that was even possible while keeping PNG format compatibility. But the fpng and fpnge C/C++ libraries showed it was, and today you can take advantage of those advances in a general purpose PNG library in Rust!
-
When the QOI format was first announced it wasn't clear that was even possible while keeping PNG format compatibility. But the fpng and fpnge C/C++ libraries showed it was, and today you can take advantage of those advances in a general purpose PNG library in Rust!