1# Rust Image Release Notes 2 3Rust image aims to be a pure-Rust implementation of various popular image formats. Accompanying reading/write support, rust image provides basic imaging processing function. See `README.md` for further details. 4 5## Known issues 6 - Images with *n* bit/channel (*n ≠ 8*) are not well supported but basic 7 support for 16-bit is available and implemented for PNG. 8 - Not all Interlaced (progressive) or animated images are well supported. 9 - The color space information of pixels is not clearly communicated. 10 11## Changes 12 13### Version 0.23.4 14 15- Improved the performance of decoding animated gifs 16- Added `crop_imm` which functions like `crop` but on a shared reference 17- The gif `DisposalMethod::Any` is treated as `Keep`, consistent with browsers 18- Most errors no longer allocate a string, instead implement Display. 19- Add some implementations of `Error::source` 20 21### Version 0.23.3 22 23- Added `ColorType::has_alpha` to facilitate lossless conversion 24- Recognize extended WebP formats for decoding 25- Added decoding and encoding for the `farbfeld` format 26- Export named iterator types created from various `ImageBuffer` methods 27- Error in jpeg encoder for images larger than 65536 pixels, fixes panic 28 29### Version 0.23.2 30 31- The dependency on `jpeg-decoder` now reflects minimum requirements. 32 33### Version 0.23.1 34 35- Fix cmyk_to_rgb (jpeg) causing off by one rounding errors. 36- A number of performance improvements for jpeg (encode and decode), bmp, vp8 37- Added more details to errors for many formats 38 39### Version 0.23.0 40 41This major release intends to improve the interface with regards to handling of 42color format data and errors for both decoding and encoding. This necessitated 43many breaking changes anyways so it was used to improve the compliance to the 44interface guidelines such as outstanding renaming. 45 46It is not yet perfect with regards to color spaces but it was designed mainly 47as an improvement over the current interface with regards to in-memory color 48formats, first. We'll get to color spaces in a later major version. 49 50- Heavily reworked `ColorType`: 51 - This type is now used for denoting formats for which we support operations 52 on buffers in these memory representations. Particularly, all channels in 53 pixel types are assumed to be an integer number of bytes (In terms of the 54 Rust type system, these are `Sized` and one can crate slices of channel 55 values). 56 - An `ExtendedColorType` is used to express more generic color formats for 57 which the library has limited support but can be converted/scaled/mapped 58 into a `ColorType` buffer. This operation might be fallible but, for 59 example, includes sources with 1/2/4-bit components. 60 - Both types are non-exhaustive to add more formats in a minor release. 61 - A work-in-progress (#1085) will further separate the color model from the 62 specific channel instantiation, e.g. both `8-bit RGB` and `16-bit BGR` 63 are instantiations of `RGB` color model. 64- Heavily rework `ImageError`: 65 - The top-level enum type now serves to differentiate cause with multiple 66 opaque representations for the actual error. These are no longer simple 67 Strings but contains useful types. Third-party decoders that have no 68 variant in `ImageFormat` have also been considered. 69 - Support for `Error::source` that can be downcast to an error from a 70 matching version of the underlying decoders. Note that the version is not 71 part of the stable interface guarantees, this should not be relied upon 72 for correctness and only be used as an optimization. 73 - Added image format indications to errors. 74 - The error values produced by decoder will be upgraded incrementally. See 75 something that still produces plain old String messages? Feel free to 76 send a PR. 77- Reworked the `ImageDecoder` trait: 78 - `read_image` takes an output buffer argument instead of allocating all 79 memory on its own. 80 - The return type of `dimensions` now aligns with `GenericImage` sizes. 81 - The `colortype` method was renamed to `color_type` for conformity. 82- The enums `ColorType`, `DynamicImage`, `imageops::FilterType`, `ImageFormat` 83 no longer re-export all of their variants in the top-level of the crate. This 84 removes the growing pollution in the documentation and usage. You can still 85 insert the equivalent statement on your own: 86 `use image::ImageFormat::{self, *};` 87- The result of `encode` operations is now uniformly an `ImageResult<()>`. 88- Removed public converters from some `tiff`, `png`, `gif`, `jpeg` types, 89 mainly such as error conversion. This allows upgrading the dependency across 90 major versions without a major release in `image` itself. 91- On that note, the public interface of `gif` encoder no longer takes a 92 `gif::Frame` but rather deals with `image::Frame` only. If you require to 93 specify the disposal method, transparency, etc. then you may want to wait 94 with upgrading but (see next change). 95- The `gif` encoder now errors on invalid dimensions or unsupported color 96 formats. It would previously silently reinterpret bytes as RGB/RGBA. 97- The capitalization of `ImageFormat` and other enum variants has been 98 adjusted to adhere to the API guidelines. These variants are now spelled 99 `Gif`, `Png`, etc. The same change has been made to the name of types such as 100 `HDRDecoder`. 101- The `Progress` type has finally received public accessor method. Strange that 102 no one reported them missing. 103- Introduced `PixelDensity` and `PixelDensityUnit` to store DPI information in 104 formats that support encoding this form of meta data (e.g. in `jpeg`). 105 106### Version 0.22.5 107 108- Added `GenericImage::copy_within`, specialized for `ImageBuffer` 109- Fixed decoding of interlaced `gif` files 110- Prepare for future compatibility of array `IntoIterator` in example code 111 112### Version 0.22.4 113 114- Added in-place variants for flip and rotate operations. 115- The bmp encoder now checks if dimensions are valid for the format. It would 116 previously write a subset or panic. 117- Removed deprecated implementations of `Error::description` 118- Added `DynamicImage::into_*` which convert without an additional allocation. 119- The PNG encoder errors on unsupported color types where it had previously 120 silently swapped color channels. 121- Enabled saving images as `gif` with `save_buffer`. 122 123### Version 0.22.3 124 125- Added a new module `io` containing a configurable `Reader`. It can replace 126 the bunch of free functions: `image::{load_*, open, image_dimensions}` while 127 enabling new combinations such as `open` but with format deduced from content 128 instead of file path. 129- Fixed `const_err` lint in the macro expanded implementations of `Pixel`. This 130 can only affect your crate if `image` is used as a path dependency. 131 132### Version 0.22.2 133 134- Undeprecate `unsafe` trait accessors. Further evaluation showed that their 135 deprecation should be delayed until trait `impl` specialization is available. 136- Fixed magic bytes used to detect `tiff` images. 137- Added `DynamicImage::from_decoder`. 138- Fixed a bug in the `PNGReader` that caused an infinite loop. 139- Added `ColorType::{bits_per_pixel, num_components}`. 140- Added `ImageFormat::from_path`, same format deduction as the `open` method. 141- Fixed a panic in the gif decoder. 142- Aligned background color handling of `gif` to web browser implementations. 143- Fixed handling of partial frames in animated `gif`. 144- Removed unused direct `lzw` dependency, an indirect dependency in `tiff`. 145 146### Version 0.22.1 147 148- Fixed build without no features enabled 149 150### Version 0.22 151 152- The required Rust version is now `1.34.2`. 153- Note the website and blog: [image-rs.org][1] and [blog.image-rs.org][2] 154- `PixelMut` now only on `ImageBuffer` and removed from `GenericImage` 155 interface. Prefer iterating manually in the generic case. 156- Replaced an unsafe interface in the hdr decoder with a safe variant. 157- Support loading 2-bit BMP images 158- Add method to save an `ImageBuffer`/`DynamicImage` with specified format 159- Update tiff to `0.3` with a writer 160- Update png to `0.15`, fixes reading of interlaced sub-byte pixels 161- Always use custom struct for `ImageDecoder::Reader` 162- Added `apply_without_alpha` and `map_without_alpha` to `Pixel` trait 163- Pixel information now with associated constants instead of static methods 164- Changed color structs to tuple types with single component. Improves 165 ergonomics of destructuring assignment and construction. 166- Add lifetime parameter on `ImageDecoder` trait. 167- Remove unecessary `'static` bounds on affine operations 168- Add function to retrieve image dimensions without loading full image 169- Allow different image types in overlay and replace 170- Iterators over rows of `ImageBuffer`, mutable variants 171 172[1]: https://www.image-rs.org 173[2]: https://blog.image-rs.org 174 175### Version 0.21.2 176 177- Fixed a variety of crashes and opaque errors in webp 178- Updated the png limits to be less restrictive 179- Reworked even more `unsafe` operations into safe alternatives 180- Derived Debug on FilterType and Deref on Pixel 181- Removed a restriction on DXT to always require power of two dimensions 182- Change the encoding of RGBA in bmp using bitfields 183- Corrected various urls 184 185### Version 0.21.1 186 187- A fairly important bugfix backport 188- Fixed a potentially memory safety issue in the hdr and tiff decoders, see #885 189- See [the full advisory](docs/2019-04-23-memory-unsafety.md) for an analysis 190- Fixes `ImageBuffer` index calculation for very, very large images 191- Fix some crashes while parsing specific incomplete pnm images 192- Added comprehensive fuzzing for the pam image types 193 194### Version 0.21 195 196- Updated README to use `GenericImageView` 197- Removed outdated version number from CHANGES 198- Compiles now with wasm-unknown-emscripten target 199- Restructured `ImageDecoder` trait 200- Updated README with a more colorful example for the Julia fractal 201- Use Rust 1.24.1 as minimum supported version 202- Support for loading GIF frames one at a time with `animation::Frames` 203- The TGA decoder now recognizes 32 bpp as RGBA(8) 204- Fixed `to_bgra` document comment 205- Added release test script 206- Removed unsafe code blocks several places 207- Fixed overlay overflow bug issues with documented proofs 208 209### Version 0.20 210 211- Clippy lint pass 212- Updated num-rational dependency 213- Added BGRA and BGR color types 214- Improved performance of image resizing 215- Improved PBM decoding 216- PNM P4 decoding now returns bits instead of bytes 217- Fixed move of overlapping buffers in BMP decoder 218- Fixed some document comments 219- `GenericImage` and `GenericImageView` is now object-safe 220- Moved TIFF code to its own library 221- Fixed README examples 222- Fixed ordering of interpolated parameters in TIFF decode error string 223- Thumbnail now handles upscaling 224- GIF encoding for multiple frames 225- Improved subimages API 226- Cargo fmt fixes 227 228### Version 0.19 229 230- Fixed panic when blending with alpha zero. 231- Made `save` consistent. 232- Consistent size calculation. 233- Fixed bug in `apply_with_alpha`. 234- Implemented `TGADecoder::read_scanline`. 235- Use deprecated attribute for `pixels_mut`. 236- Fixed bug in JPEG grayscale encoding. 237- Fixed multi image TIFF. 238- PNM encoder. 239- Added `#[derive(Hash)]` for `ColorType`. 240- Use `num-derive` for `#[derive(FromPrimitive)]`. 241- Added `into_frames` implementation for GIF. 242- Made rayon an optional dependency. 243- Fixed issue where resizing image did not give exact width/height. 244- Improved downscale. 245- Added a way to expose options when saving files. 246- Fixed some compiler warnings. 247- Switched to lzw crate instead of using built-in version. 248- Added `ExactSizeIterator` implementations to buffer structs. 249- Added `resize_to_fill` method. 250- DXT encoding support. 251- Applied clippy suggestions. 252 253### Version 0.4 254 - Various improvements. 255 - Additional supported image formats (BMP and ICO). 256 - GIF and PNG codec moved into separate crates. 257 258### Version 0.3 259 - Replace `std::old_io` with `std::io`. 260 261### Version 0.2 262 - Support for interlaced PNG images. 263 - Writing support for GIF images (full color and paletted). 264 - Color quantizer that converts 32bit images to paletted including the alpha channel. 265 - Initial support for reading TGA images. 266 - Reading support for TIFF images (packbits and FAX compression not supported). 267 - Various bug fixes and improvements. 268 269### Version 0.1 270- Initial release 271- Basic reading support for png, jpeg, gif, ppm and webp. 272- Basic writing support for png and jpeg. 273- A collection of basic imaging processing function like `blur` or `invert` 274