Skip to content

[css-images] Require dithering in gradients #6947

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

Closed
muster-mark opened this issue Jan 13, 2022 · 3 comments
Closed

[css-images] Require dithering in gradients #6947

muster-mark opened this issue Jan 13, 2022 · 3 comments

Comments

@muster-mark
Copy link

muster-mark commented Jan 13, 2022

Since this bug was fixed (#4793) dithering has been allowed in gradients.

However in many cases, gradients are essentially unusable without dithering (if you consider their purpose to create a pleasing aesthetic) since it can cause unsightly banding which does precisely the opposite. This is a huge issue in Firefox, which does not apply dithering despite a bug being open for 11 years.

Is there any reason why the specification shouldn't/couldn't require dithering. Care would be needed to define this appropriately, since gradient functions can be used which don't actually create a gradient, and dithering would be undesirable there.

At the very least, could the spec indicate that dithering is a SHOULD rather than a MAY. e.g. something along the lines of "User agents SHOULD employ dithering where necessary to avoid banding effects."

@smfr
Copy link
Contributor

smfr commented Jan 13, 2022

Gradient rendering seems like a "quality of implementation" issue. I don't think the spec should have an opinion on dithering (and doing so may be hard for implementations that rely on underlying graphics libraries to render gradients).

@tabatkins
Copy link
Member

Yup, 100% what @smfr says. This is entirely a quality-of-implementation issue. Gradient rendering is usually deferred to the underlying graphics library, so putting a strict requirement there would make impl on some systems unnecessarily difficult, when non-dithered gradients are still okay.

(Also, testing for allowed dithering is already tricky; testing for required dithering seems impossible except in extreme cases.)

@muster-mark
Copy link
Author

OK fair enough then, will close this.

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

No branches or pull requests

3 participants