Enhancement: add option to allow hue modulatation in non-linear colourspace to match CSS filter hue-rotate
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
### What are you trying to achieve?
sharp's `modulate()` uses LCH convert (as mentioned [here](https://github.com/lovell/sharp/issues/2845#issuecomment-899513269)), therefore result of `modulate({ hue: 180})` is differs from CSS-filter `hue-rotate(180deg)`
### When you searched for similar issues, what did you find that might be related?
Not found any related issues or solutions.
### Please provide sample image(s) that help explain this question
Result with sharp `modulate({ hue: 180})`
Result with [cssgenerator](https://cssgenerator.org/filter-css-generator.html)

Image data:
```
{
format: 'jpeg',
size: 23572,
width: 400,
height: 268,
space: 'srgb',
channels: 3,
depth: 'uchar',
density: 72,
chromaSubsampling: '4:2:0',
isProgressive: false,
resolutionUnit: 'inch',
hasProfile: false,
hasAlpha: false,
orientation: 1
}
```
Is there any solution to make them the same? Thank you
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
No implementation files or tests are named. Start by reading sharp's modulate() API and the linked discussion in issue #2845, then compare its behavior with CSS filter hue-rotate; done should mean the requested option and its matching behavior are clearly defined and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript, nodejs
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100