Chrome / Safari中的图像插值模式? [英] Image interpolation mode in Chrome/Safari?
问题描述
我需要一个图像渲染与最近邻居调整大小,而不是目前使用的双三次方式。我目前使用以下:
I need to have an image render with nearest-neighbor resizing and not the bicubic way that is currently used. I currently use the following:
ms-interpolation-mode: nearest-neighbor;
image-rendering: -moz-crisp-edges;
这适用于IE和Firefox,但不适用于Chrome和Safari。是否有任何webkit替代品或任何其他方式来实现此效果?
This works in IE and Firefox, but not in Chrome and Safari. Are there any webkit alternatives or any other way to achieve this effect?
推荐答案
>现在可以使用图像渲染:-webkit-optimize-contrast;
https://developer.mozilla.org/en-US/docs/CSS/image- render#示例
https://developer.mozilla.org/en-US/docs/CSS/image-rendering#Examples
这在当前版本的Chrome中无效,下面是一些有用的链接:
This doesn't work in current versions of Chrome, here are some useful links:
- http ://vaughnroyko.com/state-of-nearest-neighbor-interpolation-in-canvas/
- 图像缩放CSS:是有一个webkit的替代-moz-边缘?
- http://vaughnroyko.com/state-of-nearest-neighbor-interpolation-in-canvas/
- Image scaling by CSS: is there a webkit alternative for -moz-crisp-edges?
我没想到有办法。
还有一些快速Google搜索,但确认它; webkit图像插值的顶部Google结果为:
And some quick Googling all but confirms it; the top Google result for webkit image interpolation is:
http://code.google .com / p / chromium / issues / detail?id = 1502
2008年9月报告,但仍未解决。
Reported in September 2008, and still not resolved.
另外: https://bugs.webkit.org/show_bug .cgi?id = 40881
如果我需要这个,我可能会写一个PHP脚本使用最近的邻居动态缩放图片。
If I needed this, I'd probably write a PHP script to dynamically scale images up using nearest neighbour.
这将工作在每个浏览器,但是你有所有额外的处理和传输开销。
This will work in every browser, but then you have all that extra processing and transfer overhead.
这篇关于Chrome / Safari中的图像插值模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!