Jump to content

Blurry reaction icons


Vikestart

Recommended Posts

Posted
22 minutes ago, Morrigan said:

They look clear to me. Are you talking about here or on your own site.

The actual image is this here:

react_confused.png

They are a bit sharper when you mouse-over them, but blurry when not.

I think the issue lies with the chosen widts and heights.

Images become blurry if you don't downsize them to a value that is the original size divided by 2 or 4, etc.

The icon images are 120px right? So they are sharp as long as they are downsized to 60px or 30px, and not 20px or 35px, etc.

Posted

It looks not blurry to me. However I don't know if this will change overall as you can upload whatever size you want of an image. I think one of my reaction icons (when I uploaded it) was 512x512.

Posted
3 minutes ago, Morrigan said:

It looks not blurry to me. However I don't know if this will change overall as you can upload whatever size you want of an image. I think one of my reaction icons (when I uploaded it) was 512x512.

Here's a comparison:

rtjrykrtyk.thumb.png.7506a7aaa737ac32261d02683c11e885.png

Feels like I need to put on a pair of glasses :p

Posted

Yes. They are blurry for me in Chrome too.

@Rikki there is a simple CSS trick to prevent blurring images like this when downscaling,

img { 
    image-rendering: optimizeSpeed;             /*                     */
    image-rendering: -moz-crisp-edges;          /* Firefox             */
    image-rendering: -o-crisp-edges;            /* Opera               */
    image-rendering: -webkit-optimize-contrast; /* Chrome (and Safari) */
    image-rendering: optimize-contrast;         /* CSS3 Proposed       */
    -ms-interpolation-mode: nearest-neighbor;   /* IE8+                */
    }

Before:
591cbe7729de4_wfkoqN30XlPX_chrome_2017-05-17_17-18-511.png.d8b7ec71ef2d3592d9cfc66234d10ede.png

After:
591cbefc75e5a_CMHITgJ47VPL_chrome_2017-05-17_17-21-551.png.8d198b242194e5da543a4eb73e1829e0.png

Posted
1 minute ago, Makoto said:

Yes. They are blurry for me in Chrome too.

@Rikki there is a simple CSS trick to prevent blurring images like this when downscaling,


img { 
    image-rendering: optimizeSpeed;             /*                     */
    image-rendering: -moz-crisp-edges;          /* Firefox             */
    image-rendering: -o-crisp-edges;            /* Opera               */
    image-rendering: -webkit-optimize-contrast; /* Chrome (and Safari) */
    image-rendering: optimize-contrast;         /* CSS3 Proposed       */
    -ms-interpolation-mode: nearest-neighbor;   /* IE8+                */
    }

Before:
591cbe7729de4_wfkoqN30XlPX_chrome_2017-05-17_17-18-511.png.d8b7ec71ef2d3592d9cfc66234d10ede.png

After:
591cbefc75e5a_CMHITgJ47VPL_chrome_2017-05-17_17-21-551.png.8d198b242194e5da543a4eb73e1829e0.png

YES!

This solves it :D

Posted
8 minutes ago, Morrigan said:

Mine shows up like number two no matter what. I am not using Chrome though.

Safari and other browsers might interpolate images differently by default. The Chrome specific adjustment in the sceenshot above is -webkit-optimize-contrast though; the others (for Firefox, Opera, and IE) may not be needed, or might even make them worse, so testing would be needed to be sure.

image.gif

Posted

Yeah, I've never actually used the others either. They are completely different interpolation methods actually (nearest-neighbor I'm pretty sure would make images look worse in IE as well, it's a cheap but ugly interpolation method), so the optimize contrast tweak is probably the only one that should be used for Chrome.

Not sure why the others were listed in that example. I just quickly copy and pasted from memory ¯\_(ツ)_/¯

Posted
17 minutes ago, amator said:

This is a problem with the last IPS update. before 4.1.19.4 downscaled images were not blurry 

 

image.gif.48583c20e486865edd63897009dbc3f5.gifIt's not specific to any update. It's just how Chrome renders images.

Actually, the same CSS rule can improve quality when applied to avatars, gallery thumbnails, and so on. I have it as a universal CSS rule on img {} because I don't think Chrome's cheap image resampling techniques are necessary or worth the quality loss anywhere.

Safari appears to use higher quality downsampling by default. Other browsers probably do too. It's just something Chrome does to try and make things marginally faster, at the cost of quality.

It's just very noticeable with reaction images, because they are an extreme case. The original images are actually pretty huge and they are downscaled significantly. The more an image is downscaled, the more apparent the loss of quality is.

Ideally, you should always avoid needing to downscale images in the browser anyways, but that's not always practical (especially with responsive images). I have a PageSpeed filter on my server which tries to automatically scale images to match the browsers rendered dimensions to partially negate this requirement, but it's far from perfect.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...