Our logo svg is getting pixelated only on Chromium based browsers.
I have seen the other questions and answers with similar issues but that didn't work out.
Any suggestion how to workaround this? I have also filled a bug in Chromium.
Example can be seen here https://cd082856.mirrord-dev.pages.dev/
Attaching screenshots.
Stuff we've tried:
2x/4x svg then resizing.
using css transform
Related
On Windows, and to a certain degree also on Mac OS, with different browsers (Firefox, Chrome, Safari), our menu bar has rather pixelated/blurry font-rendering. This is on an ASP.NET Core 2.1 site that uses Bootstrap 4.1.3 but it's easy enough to reproduce with just simple HTML: https://jsfiddle.net/2tgc9r84/
<html>
<body style="background-color:#e72c87;">
<p style="font-size:20pt;">
This is some text that looks terrible.
</p>
</body>
</html>
Interestingly, the same font renders just fine in other areas of the site. I have noticed this on a 4K monitor that has 150% scaling activated but the issue also shows up with 100%. I have also tried this with different fonts, so apparently it's not an issue with the font, either.
Originally I thought this was an issue with transparency or transformations but finally, I tried simply changing the background color - and it turns out this blurriness is very obvious with red and dark blue (and of course, combinations of those, like magenta), and pretty much invisible with most other colors. Also, by changing the main background color, I can reproduce the issue for the other areas.
You can directly have a look at the site where this occurs here: https://beat-the-rhythm-vr.com/Home/Social (the navigation with the blurry text shows up after accepting the cookies).
Here's an image that shows the effect with different backgrounds, and also rendered on Mac OS (the Mac OS screenshots appear smaller in the image):
As far as I can tell, this does not happen at all on iOS. On the Mac, I don't quite see the issue on the screen but it does become obvious when making a screenshot. This could, however, also be an artifact due to scaling on the screenshot.
This is what it looks like on iOS (I get the same blurriness on Windows when making the Window small enough to get the same layout as on mobile, so that's also not the issue causing this / fixing this):
The obvious question: Is there any way to fix this, and if so, how?
EDIT: This is in addition to the comment on Porter's answer (I can't add screenshots in comments, so I'm posting this here):
EDIT 2: While this article is about a slightly different issue, my guess is that what I'm seeing is really just a limitation of ClearType that is related to what the article outlines: Color-aware ClearType requires access to fixed background pixels, which is a problem if you don't know what the background pixels are, or if they aren't fixed
ClearType apparently doesn't work when the background color isn't known, and from what I'm seeing, it seems to be designed primarily for black text on white backgrounds, also works well with light colors on dark backgrounds but not really so much for red/blue/magenta backgrounds (and any font-color).
I am unable to reproduce this on a 1080p or 4K display, with either mobile or web view on Firefox and Chrome. Fonts do tend to blend with the background color, so not every pixel of the font is going to be the same color; It'll blend on the edges. The smaller the font, the less pixels it has to work with for blending. If you use a larger font, does the same problem occur?
I have converted a badge/image from PNG to SVG in order to be able to re-use the asset in various sizes etc.
The problem is that depending on the specific webpage i'm embedding the SVG on, it either looks super crisp (as intended) or looks bad with some sort of anti-aliasing gone horribly wrong.
Even on the pages where the SVG looks crisp after load, I only have to scroll the page a bit until it looks horrible as well.
Please look at the screenshots below to see the exact difference on the BADGE (SVG):
It seems the browser only messes with the SVG right where the SVG meets the image behind it. The SVG is only slightly transparent in the gray center, so that should not be the cause of it.
I have tested in Chrome, Edge, Safari which all do the same thing.
Does anybody know what might be the cause of this?
I found a fix to what clearly seems to be a somehow undiscovered big bug in all modern browsers in regards to handling SVG through CSS as a background on an element overlapping another element with background/image.
The fix for my case was simply adding a background-color to the element. Since the element is completely round I can simply make a border-radius as well, so the background will never appear.
If the element however was not a complete round circle, this would not be a workable fix.
Was using Photoshop's Quick Export to PNG with a 250x59px grayscale image. Chrome vs Safari vs Firefox comparison (ok nevermind about Firefox it's whack):
Tried searching the chromium groups for anything similar but didn't find anything specifically like this. Anyone know what's going on? Only seems to happen on smaller sized images, this same image not scaled down from 2000+ px does not show the same inner glow-y stuff.
Link to actual file:
https://s3-us-west-1.amazonaws.com/haven-images/greyscale_logo_250x59.png
When designing my site i noticed that under dark backgrounds all of the images I used as sprites turn out like this:
I have tried multiple versions on PNGs and GIFs. IT works fine under firefox.
However, if i do not use sprites the image displays as:
This is the same exact image just without any positioning tags.
Can anyone help?
I fixed it. The issue was my cache needed to be cleared!
I use Chrome 15.0.874.106 m
My issue may be related to (but not quite the same) :
Strange scrollbars around the svg background in chrome
or
scrollbars in chrome
Considering these other stackoverflow questions on Chrome+svg, i suspect a bug in chrome.
So my issue :
i include an svg in a simple html page.
Under chrome everything seems fine. When i zoom in, svg is correctly resized.
Issue is that when i zoomOut then, some unwanted scrollbars show right and below.
(as i use a mouse wheel, they sometime show only once every other mouse wheel click).
I tried to style overflow:hidden or overflow:visible : scrollbars are still there.
Whenever i reload, display is fine again : scrollbars disappear.
You can have a look at this test html file (if you use chrome !) :
http://www.akelai.fr/logo/
Any (easy) fallback solution ? Thanks
This is a bug in the WebKit rendering engine, so the problem is reproducible in both Chrome and Safari. The bug has been fixed in Version 528+ on Nov 18, 2011, and I verified it is fixed in the most recent nightly build.
https://bugs.webkit.org/show_bug.cgi?id=43018
Hopefully that means the next major release of both Chrome and Safari will fix the problem.