Skip to content

Much faster standard PNG writing #55

@richgel999

Description

@richgel999

Using more modern zlib compression libs, it's possible to greatly speed up PNG writing while still writing fully standard PNG's that are reasonably compressed. The possible speed gains are large, I estimate around 2-15x vs. stb_image/lodepng/libpng. (Possibly even faster using libdeflate, a modern Deflate compressor, which I didn't have time to hook up.)

https://twitter.com/richgel999/status/1470696769470271493

Quick PNG writing bench, 2k 32bpp, ~7x faster vs. stbi_write_png:

miniz.h lv1g: .173 secs 9.99MB
lodepng+miniz f0: .256 9.99
miniz lvl3g: .498 8.91
miniz lvl5: .596 8.86
stbi f0 lvl 5: .895 11.41
stbi f0: .944 11.39
lodepng+miniz: .985 5.96
stbi: 1.247 8.15
lodepng: 2.311 5.89

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions