0

as the title says. Is it possible to use only one picture that is already suit for retina, but when not using a retina screen, the picture automatically resizes/crops down to be a non-retina picture? I'm having this problem with IE (and I'm using a PC). All my picture looks great in other browsers such as Chrome, Opera, Moz and so on. But when I'm looking at the same picture in IE, it have these "ugly edges".

I saw this blogpost, but he is using two picture/images. I don't want that if it possible ofcourse.

var retina = window.devicePixelRatio > 1;

if (retina) {
    var html = '<img src="my-high-res-image.jpg">';
}
else {
    var html = '<img src="my-low-res-image.jpg">';
}

To be more specific: If my image is lets say 500x500 and in my CSS I shrink it to 100x100 px because of retina screens. But if the screen is not retina and I'm using that 500x500 picture which I shrink, it will have these "crispy edges".

To show you what I mean, I've taken two screenshots of the same picture I'm using, using Chrome and IE(Edge). The original size of the images below is 500x500 but is downsized to 100x100.

enter image description here Chrome

enter image description here IE

So back to my question if I wasn't clear enough: Can I use one image, but tell it to be retina or not when the need is given?

maverick
  • 800
  • 2
  • 13
  • 30

1 Answers1

0

Its the way IE handles image resampling in the browser. You should be able to fix this by using this in your CSS:

-ms-interpolation-mode: bicubic;

By default it uses: -ms-interpolation-mode: nearest-neighbor;

Swapping the resampling method might solve your problem depending on what version of IE you are using.

Here's what CSS Tricks has to say:

http://css-tricks.com/ie-fix-bicubic-scaling-for-images/

Chris Spittles
  • 15,023
  • 10
  • 61
  • 85