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

[filter-effects] Color space awareness #428

Open
LeaVerou opened this issue Jun 9, 2021 · 1 comment
Open

[filter-effects] Color space awareness #428

LeaVerou opened this issue Jun 9, 2021 · 1 comment

Comments

@LeaVerou
Copy link
Member

LeaVerou commented Jun 9, 2021

Currently, all filters are defined in terms of sRGB-centric SVG filters.
Since the Web is finally moving away from sRGB, we'll eventually need to make them more color space aware, either by defining them differently, or by improving the SVG filters they are based on.

This affects:

  • hue-rotate()
  • brightness()
  • grayscale()
  • invert() (@svgeesus?)
@svgeesus
Copy link
Contributor

Yup.

Filter functions must operate in the sRGB color space.
https://drafts.fxtf.org/filter-effects-2/#backdrop-filter-operation

Perhaps the easiest way would be to extend color-interpolation-filters which would make one entire filter use a different colorspace, like display-p3.

Although by default SVG filters operate in linear-light sRGB so extending this to other color spaces would involve creating linear-light versions of p3 etc.

There is also a bizarre and apparently normative note about the (CSS) filter functions:

Note: The color-interpolation-filters property has no affect on Filter Functions, which operate in the sRGB color space.

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

No branches or pull requests

2 participants