【发布时间】:2012-12-13 15:15:33
【问题描述】:
是否可以在放大图像时以任何方式禁用抗锯齿?
现在,我得到的东西看起来像这样:
使用以下 css 代码:
#bib {
width: 104px;
height: 104px;
background-image: url(/media/buttonart_back.png);
background-size: 1132px 1360px;
background-repeat: no-repeat;
}
我想要的是这样的:
简而言之,任何 CSS 标志都可以在放大图像时禁用抗锯齿,保留硬边。
也欢迎任何 javascript hack 或类似内容。
(是的,我知道 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;
但这似乎不适用于背景图像。
【问题讨论】:
标签: css background-image antialiasing