-
-
Notifications
You must be signed in to change notification settings - Fork 698
heifsave: add option to control chroma subsampling #1961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think the last component of enum values can't be a number or you get problems in bindings, so it would need to be something like Do we need such precise control? How about reusing |
Yep, makes sense, I've no idea how much if any need there will be for 4:2:2, and can imagine most systems will be optimised for 4:2:0 or 4:4:4. Do we want the same "quality" > 90 condition to apply for "auto"? In my not-very-scientific testing, HEIC and AVIF generally produce better "quality" than JPEG at a lower "quality" value, if that makes sense (they generally make better decisions about what to throw away and/or better decisions about what can be predicted). |
cfcea90
to
ad37338
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this PR to make VipsForeignSubsample
more generic and added a few comments inline to help explain the approach.
Defaults to no subsampling when Q>90 for consistency with jpegsave. Deprecate VipsForeignJpegSubsample enum, replace with more generic VipsForeignSubsample.
ad37338
to
3ad7363
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VipsForeignJpegSubsample
enum remains and is marked as deprecated in favour of the more generic VipsForeignSubsample
enum.
Read through it, looks great! |
@jcupitt hey, do you have any ETA for releasing this PR? I don't want to rush you. I just want to manage the internal work that depends on this PR. We need this to fix: lovell/sharp#2562 Thanks for your work! |
Hiya, it'll be in 8.11, which (guess!) will be April or May 2021. |
As discussed in #1788, providing control over the use of chroma subsampling is a genuinely useful feature for still images created via libheif and is consistently supported by all of its encoder plugins.
This PR also adds a test for this now that the CI environment supports the AVIF format.