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