高分辨率图像设置为小尺寸时 IE 缩略图像素化

Ant*_*hin 5 javascript css firefox jquery internet-explorer

当前版本的插件不支持修复透明背景图像的像素化问题。但它展示了如何使用画布修复它。添加 WebGL 功能将使其速度更快,并能够处理具有透明背景的图像。

$( document ).ready(function() {
    $('img.first').bicubicImgInterpolation({
            crossOrigin: 'anonymous' //for demo purpose
    });
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://rawgit.com/sukhoi1/Crossbrowser-Bicubic-Image-Interpolation/master/bicubicInterpolation.js"></script>

Handled by <b>Bicubic Image Interpolation</b> plugin:<br>
<img id="someId" class="first" width="200" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Text_Line_Length.png/800px-Text_Line_Length.png"><br>

IE9 to IE11 and Edge <b>pixelated thumbnail</b>:<br> 
<img class="second" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/71/Text_Line_Length.png/800px-Text_Line_Length.png" width="200" alt=""><br><br>
Run Code Online (Sandbox Code Playgroud)

我找到了一个插件,它似乎可以解决所有版本的 IE 和 Edge 浏览器的像素化问题,它被称为“Crossbrowser-Bicubic-Image-Interpolation”。

这是一个代码片段,可以解决许多使用 jQuery 的人的问题。

详细参考GitHub上的问题。