Posible duplicado:
Cómo estirar imágenes sin antialiasing
¿Es de alguna manera posible desactivar el antialiasing al escalar una imagen?
En este momento, obtengo algo que se ve así:
Usando el siguiente código CSS:
#bib { width:104px;height:104px;background-image:url(/media/buttonart_back.png);background-size:1132px 1360px; background-repeat:no-repeat;}
Lo que me gustaría es algo como esto:
En resumen, cualquier marca de CSS para desactivar el anti-aliasing al escalar imágenes, preservando los bordes duros.
Cualquier javascript javascript o similar también son bienvenidos.
(Sí, soy consciente de que php e imagemgick también pueden hacer esto, pero preferirían una solución basada en css).
ACTUALIZACIÓN Se han sugerido los siguientes:
image-rendering: -moz-crisp-edges; image-rendering: -moz-crisp-edges; image-rendering: -o-crisp-edges; image-rendering: -webkit-optimize-contrast; -ms-interpolation-mode: nearest-neighbor;
Pero eso no parece funcionar en las imágenes de fondo.
Pruebe esto, es una solución para eliminarlo en todos los navegadores.
img { image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */ image-rendering: -moz-crisp-edges; /* Firefox */ image-rendering: -o-crisp-edges; /* Opera */ image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */ image-rendering: pixelated; /* Chrome */ image-rendering: optimize-contrast; /* CSS3 Proposed */ -ms-interpolation-mode: nearest-neighbor; /* IE8+ */ }
Fuentes:
http://nullsleep.tumblr.com/post/16417178705/how-to-disable-image-smoothing-in-modern-web-browsers
http://updates.html5rocks.com/2015/01/pixelated
GitaarLAB
CSS que funciona solo en Firefox :
img { image-rendering: -moz-crisp-edges; }
Me funcionó ( Firefox 16.0 )