png
PNG decoding and encoding library in pure Rust
0.18.1
202M downloads/mo
#504 most downloaded on crates.io
image-rs/image-png
What this package is like to depend on
Last release 6 months ago
14 Feb 2026
Release timing varies
gaps range from 2 weeks to 7 months
Some releases are documented
notes for 29 of 56 stable releases
1 version withdrawn
withdrawn after publishing
11 years old
61 releases · first in 2015
2 releases in the last 12 months
see the full history below
Release timeline
61 releases · May 2015 to Feb 2026Releases
latest 60 of 61-
0.18.114 Feb 2026Release notes
Open source →Additions
- Added
Filter::MinEntropyfor encoding, which selects the filter that minimizes the Shannon entropy of the filtered row. (#647) - Made
ScaledFloat::SCALINGconstant public. (#650) - Support skipping chunks without loading them into memory. (#630)
- Allow full unfiltering for partial data, enabling progressive decoding use cases. (#664)
Changes
- Improved Paeth unfilter auto-vectorization by changing how loop state is maintained. (#635)
- Added
portable_simdPaeth unfiltering for 3bpp and 4bpp images on nightly. (#632, #633) - Add early exit for adaptive filter selection when a perfect filter is found. (#646)
- Ignore duplicate
acTLchunks instead of producing errors. (#651) - Require IDAT chunk(s) before fdAT chunks, as mandated by PNG specification. (#653)
- Enforce
acTLframe counts to be valid PNG 4-byte integers (capped at 2^31-1). (#673)
Fixes
- Added
-
0.18.029 Aug 2025Release notes
Open source →API Breaking Changes
- Removed deprecated
Info::encodeandEncoder::set_srgbmethods. - Improved the compression settings API for encoding.
Decodernow requires a reader that implementsSeekandBufReadtraits.- Bump bitflags dependency to 2.0.
StreamingDecoder::updatenow takes a structuredUnfilterBufargument instead of a direct reference to a vector. This allows in-place decompression. There is a public constructor forUnfilterBuf.- The methods
Decoder::output_buffer_sizeandoutput_line_sizenow returnOption<usize>to reflect that these calculations no longer overflow on some targets where the required buffers can not be represented in the address space. They return the mathematically correct size where possible. - The
Decodedenum returned fromStreamingDecoder::updatewas simplified to no longer contains any chunk payload data. Instead, it now contains only chunk events where every chunk that was started will eventually be ended byChunkComplete,BadAncillaryChunkorSkippedAncillaryChunk. - Ancillary chunks, i.e. those not critical to decoder interpretation of the
file, which fail to parse are now terminated with a
BadAncillaryChunkevent but no longer returned aDecodingError. This includes text chunks as well as many metadata chunks (except forfcTLthat we deem crucial to the parser's understanding of the image sequence in an APNG despite being technically ancillary).
Additions
- Added
Reader::read_rowmethod. - Add support for parsing eXIf chunk.
- Treat most auxiliary chunk errors as benign.
- Added
splat_interlaced_row, which implements an alternative method for merging Adam7 interlaced lines into the output buffer that is more suitable for the presentation of progressive states of the buffer. - Added
Adam7Variantdocumenting the various methods for applying interlaced rows and to prepare an API to progressively read frames throughDecoder.
Changes
- The decoding of Adam7 interlaced data is now much faster.
- The
acTLchunk is now ignored when it is invalid, instead of producing errors while reading or decoding the following APNG chunks. - The requirement of the
fcTLchunk for the default image to match the IHDR's indicate image size is now enforced. - More minor format errors in auxiliary chunks are now ignored by the decoder, instead disregarding the malformed chunk.
- Adam7 Interlacing on 32-bit targets now handles some cases correctly that previously wrote some bytes to the wrong pixel indices due to overflows.
- Removed deprecated
-
0.18.0-rc.302 Jul 2025 pre-releaseRelease notes
Open source →Cumulative to the last 0.17 release
-
Removed deprecated
Info::encodeandEncoder::set_srgbmethods. -
Improved the compression settings API for encoding.
-
Decodernow requires a reader that implementsSeekandBufReadtraits. -
Bump bitflags dependency to 2.0.
-
StreamingDecoder::updatenow takes a structuredUnfilterBufargument
instead of a direct reference to a vector. This allows in-place
decompression. There is a public constructor forUnfilterBuf. -
The methods
Decoder::output_buffer_sizeandoutput_line_sizenow return
Option<usize>to reflect that these calculations no longer overflow on some
targets where the required buffers can not be represented in the address
space. They return the mathematically correct size where possible. -
Added
Reader::read_rowmethod. -
Add support for parsing eXIf chunk.
-
Treat most auxiliary chunk errors as benign.
-
Added
splat_interlaced_row, which implements an alternative method for
merging Adam7 interlaced lines into the output buffer that is more suitable
for the presentation of progressive states of the buffer. -
Added
Adam7Variantdocumenting the various methods for applying interlaced
rows and to prepare an API to progressively read frames throughDecoder. -
The decoding of Adam7 interlaced data is now much faster.
-
The
acTLchunk is now ignored when it is invalid, instead of producing
errors while reading or decoding the following APNG chunks. -
The requirement of the
fcTLchunk for the default image to match the IHDR's
indicate image size is now enforced. -
More minor format errors in auxiliary chunks are now ignored by the decoder,
instead disregarding the malformed chunk. -
Adam7 Interlacing on 32-bit targets now handles some cases correctly that
previously wrote some bytes to the wrong pixel indices due to overflows.
-
-
0.18.0-rc.210 Jun 2025 pre-releaseNothing published for this version
-
0.18.0-rc03 Mar 2025 pre-releaseNothing published for this version
-
0.17.1620 Dec 2024 -
0.17.1507 Dec 2024Release notes
Open source →Added
- Add a public API to advance to the next frame in APNG decoder (#518)
- Add APIs to write ICC and EXIF chunks (#526)
- Add support for parsing the sBIT chunk (#524)
- Add support for parsing the bKGD chunk (#538)
- Add support for parsing the cICP chunk (#529)
- Add support for parsing mDCV and cLLI chunks (#528, (#543))
Changed
Fixed
-
0.17.1427 Sep 2024Release notes
Open source →- Updated to miniz_oxide 0.8.0.
- Added public API to consume interlaced rows one by one (#495)
- Improved support for resuming decoding after an
UnexpectedEof, which lets you start parsing a file before it's fully received over the network (#496) - Fixed some broken links in documentation, improved some documentation comments
Release notes
Open source →- Updated to miniz_oxide 0.8.0.
- Added public API to consume interlaced rows one by one (#495)
- Improved support for resuming decoding after an
UnexpectedEof, which lets you start parsing a file before it's fully received over the network (#496) - Fixed some broken links in documentation, improved some documentation comments
-
0.17.1319 Feb 2024 -
0.17.1216 Feb 2024 withdrawnRelease notes
Open source →- Reject zero-sized frames.
- Optimized decoding of paletted images.
- Removed remaining uses of miniz_oxide for decoding.
- Correct lifetime used for
Infostruct. - Fix build issue with
-Z minimal-versions.
-
0.17.1113 Jan 2024Release notes
Open source →- Ignore subsequent iCCP chunks to match libpng behavior.
- Added an option to ignore ancillary chunks with invalid CRC.
- Added
new_with_infoconstructor for encoder. - Removed hard-coded memory limits.
- No longer allow zero sized images.
- Added
Reader::finishto read all the auxiliary chunks that comes after the image.
-
0.17.1018 Aug 2023 -
0.17.910 Jun 2023Release notes
Open source →- Fixed a bug in ICC profile decompression.
- Improved unfilter performance.
-
0.17.811 Apr 2023Release notes
Open source →- Increased MSRV to 1.57.0.
- Substantially optimized encoding and decoding:
- Autovectorize filtering and unfiltering.
- Make the "fast" compression preset use fdeflate.
- Switch decompression to always use fdeflate.
- Updated to miniz_oxide 0.7.
- Added an option to ignore checksums.
- Added corpus-bench example which measures the compression ratio and time to re-encode and subsequently decode a corpus of images.
- More fuzz testing.
-
0.17.8-rc21 Mar 2023 pre-releaseNothing published for this version
-
0.17.730 Oct 2022 -
0.17.605 Sep 2022Release notes
Open source →- Added
Decoder::read_header_infoto query the information contained in the PNG header. - Switched to using the flate2 crate for encoding.
- Added
-
0.17.502 Mar 2022Release notes
Open source →- Fixed a regression, introduced by chunk validation, that made the decoder
sensitive to the order of
gAMA,cHRM, andsRGBchunks.
- Fixed a regression, introduced by chunk validation, that made the decoder
sensitive to the order of
-
0.17.426 Feb 2022Release notes
Open source →- Added
{Decoder,StreamDecoder}::set_ignore_text_chunkto disable decoding of ancillary text chunks during the decoding process (chunks decoded by default). - Added duplicate chunk checks. The decoder now enforces that standard chunks such as palette, gamma, … occur at most once as specified.
- Added
#[forbid(unsafe_code)]again. This may come at a minor performance cost when decoding ASCII text for now. - Fixed a bug where decoding of large chunks (>32kB) failed to produce the correct result, or fail the image decoding. As new chunk types are decoded this introduced regressions relative to previous versions.
- Added
-
0.17.312 Feb 2022Release notes
Open source →- Fixed a bug where
Writer::finishwould not drop the underlying writer. This would fail to flush and leak memory when using a buffered file writers. - Calling
Writer::finishwill now eagerly flush the underlying writer, returning any error that this operation may result in. - Errors in inflate are now diagnosed with more details.
- The color and depth combination is now checked in stream decoder.
- Fixed a bug where
-
0.17.208 Oct 2021Release notes
Open source →- Added support for encoding and decoding tEXt/zTXt/iTXt chunks.
- Added
Encoder::validate_sequenceto enable validation of the written frame sequence, that is, if the number of written images is consistent with the animation state. - Validation is now off by default. The basis of the new validation had been introduced in 0.17 but this fixes some cases where this validation was too aggressive compared to previous versions.
- Added
Writer::finishto fully check the write of the end of an image instead of silently ignoring potential errors inDrop. - The
Writer::write_chunkmethod now validates that the computed chunk length does not overflow the limit set by PNG. - Fix an issue where the library would panic or even abort the process when
flushorwriteof an underlying writer panicked, or in some other uses ofStreamWriter.
-
0.17.129 Aug 2021 -
0.17.014 Aug 2021Release notes
Open source →- Increased MSRV to 1.46.0
- Rework output info usage
- Implement APNG encoding
- Improve ergonomics of encoder set_palette and set_trns methods
- Make Info struct non-exhaustive
- Make encoder a core feature
- Default Transformations to Identity
- Add Adaptive filtering method for encoding
- Fix SCREAM_CASE on ColorType variants
- Forbid unsafe code
-
0.16.808 Dec 2020Nothing published for this version
-
0.16.718 Jul 2020 -
0.16.627 Jun 2020Release notes
Open source →- Fixed silent integer overflows in buffer size calculation, resulting in panics from assertions and out-of-bounds accesses when actually decoding. This improves the stability of 32-bit and 16-bit targets and make decoding run as stable as on 64-bit.
- Reject invalid color/depth combinations. Some would lead to mismatched output buffer size and panics during decoding.
- Add
Cloneimpl forInfostruct.
-
0.16.513 Jun 2020Release notes
Open source →- Decoding of APNG subframes is now officially supported and specified. Note that dispose ops and positioning in the image need to be done by the caller.
- Added encoding of indexed data.
- Switched to
miniz_oxidefor decompressing image data, with 30%-50% speedup in common cases and up to 200% in special ones. - Fix accepting images only with consecutive IDAT chunks, rules out data loss.
-
0.16.401 Jun 2020Release notes
Open source →- The fdAT frames are no longer inspected when the main image is read. This
would previously be the case for non-interlaced images. This would lead to
incorrect failure and, e.g. an error of the form
"invalid filter method". - Fix always validating the last IDAT-chunks checksum, was sometimes ignored.
- Prevent encoding color/bit-depth combinations forbidden by the specification.
- The fixes for APNG/fdAT enable further implementation. The next release is expected to officially support APNG.
- The fdAT frames are no longer inspected when the main image is read. This
would previously be the case for non-interlaced images. This would lead to
incorrect failure and, e.g. an error of the form
-
0.16.318 Apr 2020Release notes
Open source →- Fix encoding with filtering methods Up, Avg, Paeth
- Optimize decoding throughput by up to +30%
-
0.16.202 Apr 2020 -
0.16.103 Mar 2020 -
0.16.001 Mar 2020Release notes
Open source →- Fix a bug compressing images with deflate
- Address use of deprecated error interfaces
-
0.15.307 Jan 2020Release notes
Open source →- Fix panic while trying to encode empty images. Such images are no longer
accepted and error when calling
write_headerbefore any data has been written. The specification does not permit empty images.
- Fix panic while trying to encode empty images. Such images are no longer
accepted and error when calling
-
0.15.203 Dec 2019 -
0.15.117 Nov 2019Release notes
Open source →- Fix encoding writing invalid chunks. Images written can be corrected: see https://github.com/image-rs/image/issues/1074 for a recovery.
- Fix a panic in bit unpacking with checked arithmetic (e.g. in debug builds)
- Added better fuzzer integration
- Update
term,randdev-dependency - Note: The
showexample program requires a newer compiler than 1.34.2 on some targets due to depending onglium. This is not considered a breaking bug.
-
0.15.018 Jul 2019Nothing published for this version
-
0.14.124 Apr 2019Nothing published for this version
-
0.14.011 Jan 2019Nothing published for this version
-
0.13.228 Nov 2018Nothing published for this version
-
0.13.119 Oct 2018Nothing published for this version
-
0.13.002 Oct 2018Nothing published for this version
-
0.12.024 Apr 2018Nothing published for this version
-
0.11.013 Oct 2017Nothing published for this version
-
0.10.023 Sep 2017Nothing published for this version
-
0.9.025 Jun 2017Nothing published for this version
-
0.8.012 Jun 2017Nothing published for this version
-
0.7.027 Apr 2017Nothing published for this version
-
0.6.209 Jan 2017Nothing published for this version
-
0.6.109 Jan 2017Nothing published for this version
-
0.6.006 Jan 2017Nothing published for this version
-
0.5.230 Jul 2016Nothing published for this version
-
0.5.116 May 2016Nothing published for this version
-
0.5.004 May 2016Nothing published for this version
-
0.4.329 Apr 2016Nothing published for this version
-
0.4.212 Mar 2016Nothing published for this version
-
0.4.129 Dec 2015Nothing published for this version
-
0.4.010 Nov 2015Nothing published for this version
-
0.3.115 Jun 2015Nothing published for this version
-
0.3.008 Jun 2015Nothing published for this version
-
0.2.026 May 2015Nothing published for this version