类似于 Imagemagick 的 JavaScript 库(即在最大化图片保真度的同时调整图像和图片大小)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5343915/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JavaScript library similar to Imagemagick (i.e., resize images and pictures while maximizing picture fidelity)?
提问by Crashalot
We would like to simulate Imagemagick functionality, but only in Javascript. Do any libraries exist?
我们想模拟 Imagemagick 功能,但只能在 Javascript 中。是否存在任何库?
Specifically, the goal is to display thumbnails of images without distorting the thumbnail to the point where it is hardly resembles the original. This often happens with simple resizing via CSS.
具体来说,目标是显示图像的缩略图,而不会将缩略图扭曲到与原始图像几乎不相似的程度。这通常发生在通过 CSS 简单调整大小时。
One approach is to resize images on the server with Imagemagick.
一种方法是使用 Imagemagick 调整服务器上的图像大小。
The question is, if we don't want to store the thumbnails (because the originals are loaded from a third party which doesn't supply thumbnails), can we simulate Imagemagick's natural and high-fidelity resizing functionality with a Javascript library?
问题是,如果我们不想存储缩略图(因为原件是从不提供缩略图的第三方加载的),我们是否可以使用 Javascript 库模拟 Imagemagick 的自然和高保真大小调整功能?
Thanks!
谢谢!
采纳答案by Agnius Vasiliauskas
You can try Processing.jslibrary. On the other hand you can port ImageMagick resize functionality to HTML5/Canvas + Javascript technology.
你可以试试Processing.js库。另一方面,您可以将 ImageMagick 调整大小功能移植到 HTML5/Canvas + Javascript 技术。
good luck !
祝你好运 !
回答by sebilasse
3 years later I stumbled upon this question ;)
3 年后,我偶然发现了这个问题;)
The fun fact is that imagemagick itself exists in javascript. But google (page1) and github somehow do not find it. Github fails because the main project (useful emscripten ports)
有趣的事实是 imagemagick 本身存在于 javascript 中。但是 google (page1) 和 github 不知何故没有找到它。Github 失败,因为主项目(有用的 emscripten 端口)
UNIX toolbox.js
UNIX 工具箱.js
just consists of the modules ...
只是由模块组成......
Here is the main project with readme: github : manuels/unix-toolbox.js
这是带有自述文件的主要项目: github:manuels/unix-toolbox.js
git clone ... --recursive
and the particular module : github : manuels/unix-toolbox.js-imagemagick