我正在使用Cropper.js并想知道是否有人知道在放大时是否可以阻止它平滑图像。我希望它保持像素化,因为我想用它来裁剪视频游戏精灵表
答案 0 :(得分:0)
我实际上已经解决了。您可以添加此CSS:
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+ */
image-rendering: pixelated /* Confirmed working in Chrome
}