We, the image-rs group, are glad to announce the release of a new version of
image library. This is especially noteworthy since it resolves
some long standing interface issues, removes some old deprecated items and
marks some new ones, and finally contains a plethora of improvement to the set
of image decoders and encoders.
We have updated the compiler requirements to Rust
together with the Debian stable release Buster. This gives us the freedom to
choose the Rust edition, many
std library improvements and basic
We will try to keep versions stable for as long as possible but may bump the
required version in a SemVer breaking release. Overall, you should view this as
a best effort and not an absolute guarantee.
A general rework of the
ImageDecoder trait. All decoders now have their own
reader types which allows greater flexibility for the future. These were
intended to offer an
std::io::Read interface only. If this leads to
performance pessimissations it would be possible to introduce dedicated methods
for concrete decoders.
unsafe interfaces have been retired. The (largely) broken generic
PixelsMut iterator of
GenericImage has been removed after its deprecation
some versions ago. Note that the specialized version on
ImageBuffer is still
available and an even more diverse set of iterators has been added for it, e.g.
A new method
DynamicImage is now
available to make saving images easier. Encode other
implementors by cloning their content into an
ImageBuffer first. The
supported formats are currently only
that list will expand in the future.
Colors as now tuple types. This had ergonomic problems in a rather ancient version of Rust. As a style help, remember that you can match tuples and slices exhaustively on the left-hand side of an assignment, like so:
let Rgb([r, g, b]) = image.get_pixel(10, 10);
replace operations no longer require both image types to be
the same but only their pixels. These changes are complementary to an update to
GenericImage::copy_from method, which previously returned a
indicate success. This could silently fail to do anything.
png library has been updated and now handles interlacing of sub-byte
pixel formats correctly.
There are already important plans for the next version. The ecosystem is slowly
moving towards edition 2018, which is now the default for new projects, and
many improvements on quality of life but also semantic clarity are dearly
missed once one has gotten used to them. We intend to make use of our
bumped compiler version to modernize code and add interoperability where
useful. Spotted a missing and useful
TryFrom? Give us a PR and we’re happy to
In an effort to remove even more
unsafety from the library there are also
some newly depreated methods on top of some previously deprated parts that were
removed. These will stay until we have figured out the best solution to replace
their current functionality and/or performance.
TryFromfor integer conversion, improvements for reference matching, nested imports, basic
constfunctions, endianess conversion on integers types,
#[repr(transparent)], more in
impl Traitreturns and many many more. ↩