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

White outline on black emojis rendered unevenly #13766

Closed
leo60228 opened this issue May 15, 2020 · 6 comments
Closed

White outline on black emojis rendered unevenly #13766

leo60228 opened this issue May 15, 2020 · 6 comments

Comments

@leo60228
Copy link
Contributor

Expected behaviour

I would expect that the white outline (introduced by #8597) on a circular emoji like 🎱 is rendered as a circle.

Actual behaviour

The shape is uneven.
Desktop Firefox (WebRender, AMD, Linux):
image
Unknown mobile browser (reported by another user):
image

Steps to reproduce the problem

Place the 🎱 emoji in a display name or message.

Specifications

This occurs on multiple instances. I'm using the v3.1.2 tag, but I don't see any change to the relevant code since it was introduced.

I'm using Firefox 73.0 on Linux with WebRender enabled. I'm not sure what browser the other user is using.

@leo60228
Copy link
Contributor Author

This filter works by making 4 copies of the image, making them solid white, and then moving them in different directions. You can get the same artifacts by doing this in an image editor:
image
I can't find a way to outline SVGs in CSS that doesn't have this problem, though. The best option might be to just modify the SVGs themselves.

@leo60228
Copy link
Contributor Author

Emojione has specifically chosen not to do this, but hasn't stated why. joypixels/emojione#234

@leo60228
Copy link
Contributor Author

leo60228 commented May 16, 2020

This svg filter has no artifacting on my browser. Note that the more obvious feMorphology also creates artifacts (as it will never go outside the bounds of the input, unlike feGaussianBlur). https://codepen.io/snuggles08/pen/BaoqjZJ

image

@ClearlyClaire
Copy link
Contributor

@leo60228 very interesting, thanks! The SVG filters seem to give a pretty good result. I'm worried about performances because of the Gaussian blur filter… but on a quick test, this doesn't seem worse than our existing 4-drop-shadow filter thing.

@leo60228
Copy link
Contributor Author

leo60228 commented May 16, 2020

The drop shadow trick does four Gaussian blurs, though they each have a radius of 0. I'm not sure if browsers optimize for this case.

@ClearlyClaire
Copy link
Contributor

@leo60228 thanks. Started to experiment a bit in a PR (#13769), the changes seem pretty inconsistent across browsers. I'd say they are mostly good though.

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