Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an option to the API to set the distance for extra channels separately, addressing #2111 .
This e.g. allows doing lossless alpha while the color is lossy, or in general to set the alpha quality independently of the color quality. We might want to experiment with this and set more sensible defaults. (Note: we can't really rely on the metrics though, since they don't really look at alpha, they just use it to blend the image to a solid background.)
Adds a parameter
D
to benchmark_xl and--alpha_distance
to cjxl.Flyby fix: correct the modular quantization adjustment to compensate for the actual bitdepth of extra channels (instead of assuming that all channels have the same bitdepth).
For some images, doing alpha losslessly results in smaller files than doing it lossy, e.g.:
So maybe we should reconsider the default behavior, and do alpha losslessly when doing high quality lossy, and only make alpha lossy when the quality is low enough. To be investigated later...