AVIF. Refactor default for `chromaSubsampling` option
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
## Feature request
### What are you trying to achieve?
For AVIF output, set `chromaSubsampling` automatically, instead of depending on the user to select correct `chromaSubsampling` for a particular image.
afaik, `sharp` doesn't upscale (increase the number of colors) `chromaSubsampling` when converting `4:2:0` input to `4:4:4` output. So there's no visual benefit in outputting `4:4:4` for the `4:2:0` input.
- whereas, `4:4:4` output is larger in size as indicated in #2850
### When you searched for similar feature requests, what did you find that might be related?
- https://github.com/lovell/sharp/issues/2562
- https://github.com/lovell/sharp/issues/2850
### What would you expect the API to look like?
No public facing API changes. Internally, `sharp` or `libvips` should dynamically set `chromaSubsampling` based on the metadata of the input, if `chromaSubsampling` override is not provided.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing related issues #2562 and #2850, then trace AVIF output handling and how input metadata reaches the chromaSubsampling option. The work is done when the default is derived from the input metadata while an explicit chromaSubsampling override remains respected; no public API change is expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100