Re: [csswg-drafts] [filter-effects] hue-rotate() should perform a true hue rotation (#8754)

The issue is that you expect it to rotate hue in HSL, but that's not what it is doing, and there is a reason for it. It uses a luminance-preserving hue rotation. This makes sense as it was created for filtering images, not rotating hues specifically in HSL.

You can see here we do a similar comparison that you do with the original, hue-rotated, and HSL hue-rotated. The results are comparable. But afterward, we have two more examples. The first takes the green which has a fairly high luminance and rotates it from 0 to 360 degrees. The second example takes blue and rotates it from 0 to 360 and has a much lower luminance. Notice how the blue rotation is much darker overall.

<img width="1330" alt="Screenshot 2023-04-24 at 5 50 10 PM" src="https://user-images.githubusercontent.com/1055125/234139976-8d74cd66-f050-4557-b5a1-1e271161c7d8.png">

So, when you are rotating hues with varying luminance, it is expected that you may get seemingly odd results if you are just expecting an HSL hue shift, but when you realize what it is doing, it actually makes a lot of sense and is a much better behavior for filtering images. HSL does not have good lightness preservation, so it is not a good choice for rotating hues in an image.


-- 
GitHub Notification of comment by facelessuser
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8754#issuecomment-1520978192 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 25 April 2023 00:09:55 UTC