Skip to content
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

Compare with CSS filter #4320

Open
abelevitin opened this issue Jan 28, 2025 · 1 comment
Open

Compare with CSS filter #4320

abelevitin opened this issue Jan 28, 2025 · 1 comment
Labels

Comments

@abelevitin
Copy link

abelevitin commented Jan 28, 2025

I need to match the CSS filter settings with the Sharp filter settings. On the front end in CSS I set the filter settings (for example, brightness, saturation), and then on the back end I need to repeat the same settings when generating the file. Is there a mapping between Sharp and CSS filter settings?

In general, I would like to make the filter settings in CSS and then be sure that this effect will be repeated when using Sharp.

First of all, brightness and saturation

@lovell
Copy link
Owner

lovell commented Jan 31, 2025

It's probably best to try a few examples and see how they compare. Perhaps you could add them here to help others.

I do know that the hue-rotate filter is different as browsers appear to use a non-linear colourspace for this whereas sharp uses linear LCH - see #3197 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants