Add TiffEncoder::set_compression() to allow controlling compression mode#2785
Add TiffEncoder::set_compression() to allow controlling compression mode#2785Shnatsel wants to merge 14 commits intoimage-rs:mainfrom
TiffEncoder::set_compression() to allow controlling compression mode#2785Conversation
…ode. Change the default from uncompressed to balanced DEFLATE with a horizontal predictor, as a more sensible default that matches imagemagick
|
Related: #2251
Given the way decoders are currently moving towards setters instead of constructor args, I would expect that encoders will move towards setters too. So you're likely just ahead of the trend. |
b3f48b5 to
e1d4cb0
Compare
|
Float compression was implemented in the |
|
I'm now wondering if it would it make sense to land support for deflate levels 1-9 in the |
|
I think it would, but it's an API break for the |
|
I'm very much okay with that. There's a bunch of API to clean up there anyways (all the direct tag reads on |
|
Turns out we can expose precise DEFLATE compression level from I'll update this PR once the |
|
Ah, sorry, that wasn't sufficient after all. I've opened image-rs/image-tiff#351 for a semver-breaking change instead. |
…rate allows that
…e deprecation notice
…loat predictor in tiff crate. Write down the rationale.
|
Marking as draft pending upstream work in |
|
This is now done, but I'm keeping it as a draft until the |
Allow controlling TIFF compression algorithm and predictor in
TiffEncoder.This PR also changes the default from uncompressed to balanced DEFLATE with a horizontal predictor. This is as a more sensible default, and matches imagemagick.
TiffEncoder::set_compression()diverges from the crate's apparent convention ofnew_with_quality, because I think it's rather silly to call this quality when it's a lossless format. I can change this if you prefer.I've manually tested the default compression method with
wondermagick(which is what I need this for) but I haven't verified the more obscure options like PackBits produce correct results.