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