Nil*_*nch 55 css background-image antialiasing
可能重复:
如何在没有抗锯齿的情况下拉伸图像
在放大图像时是否可以以任何方式禁用抗锯齿?
现在,我得到的东西看起来像这样:

使用以下css代码:
#bib { width:104px;height:104px;background-image:url(/media/buttonart_back.png);background-size:1132px 1360px;
background-repeat:no-repeat;}
Run Code Online (Sandbox Code Playgroud)
我想要的是这样的:

简而言之,任何CSS标志都可以在放大图像时禁用抗锯齿,保留硬边.
欢迎任何javascript hacks或类似的东西.
(是的,我知道php和imagemagick也可以这样做,但更喜欢基于CSS的解决方案.)
更新 以下建议:
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;
Run Code Online (Sandbox Code Playgroud)
但这似乎不适用于背景图像.
Var*_*rgr 108
试试这个,它是在所有浏览器中删除它的修复程序.
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+ */
}
Run Code Online (Sandbox Code Playgroud)
资料来源:
http://nullsleep.tumblr.com/post/16417178705/how-to-disable-image-smoothing-in-modern-web-browsers
http://updates.html5rocks.com/2015/01/pixelated
GitaarLAB
仅适用于Firefox的 CSS :
img { image-rendering: -moz-crisp-edges; }
Run Code Online (Sandbox Code Playgroud)
它对我有用(firefox 16.0)
