php GD vs ImageMagick vs Gmagick for jpg?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5282072/
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
GD vs ImageMagick vs Gmagick for jpg?
提问by dynamic
I am in the step to abandon GD for manipulating image in my website - it is awful.
我正准备放弃 GD 以在我的网站上操纵图像——这太糟糕了。
Everyone saying to use ImageMagick because they are better than GD, but what about ImageMagick vs Gmagick (Swiss Army knife of image processing)?
大家都说用ImageMagick是因为比GD好,但是ImageMagick vs Gmagick(图像处理的瑞士军刀)呢?
Zend has a pretty article here http://devzone.zend.com/article/10531talking about them.
Zend 在这里有一篇漂亮的文章http://devzone.zend.com/article/10531谈论它们。
Before I will leave for ImageMagick are there any motivation to use gmagick instead?
在我前往 ImageMagick 之前,是否有任何动机使用 gmagick 代替?
(PHP 5.3+)
(PHP 5.3+)
Edit: What's wrong with asking which is better between 2 libs? I think it's a fair question. If someone could explain the good-point of one lib over the other would help me and other people reading this question. Why close such a question??
编辑:询问两个库之间哪个更好有什么问题?我认为这是一个公平的问题。如果有人可以解释一个库相对于另一个库的优点,那将有助于我和其他人阅读这个问题。为什么关闭这样的问题?
Edit2: For everyone asking what I need to do: I think it's oblivious: users uploads images (than can be png/gif/bmp w/e) I need to convert in JPG and then store it in the database, eventually if they are too big I need to resize down them a bit.
Edit2:对于每个问我需要做什么的人:我认为它是无知的:用户上传图像(可以是 png/gif/bmp w/e)我需要以 JPG 格式转换,然后将其存储在数据库中,最终如果他们是太大了,我需要稍微缩小它们的大小。
Thanks
谢谢
采纳答案by Pekka
According to Wikipedia, GraphicsMagick is a fork from ImageMagick 5.5.2.
根据维基百科,GraphicsMagick 是 ImageMagick 5.5.2 的一个分支。
As far as I can see, GMagick comes with no new features; the fork is concentrating on better performance and stability, which as @Col says you should test and compare yourself.
据我所知,GMagick 没有任何新功能;前叉专注于更好的性能和稳定性,正如@Col 所说,你应该自己测试和比较。
From a feature perspective, if a library is needed for more than just basic resizing and cropping operations, I personally would prefer ImageMagick any day because of the vast, well-documented and illustrated library of thousands of exampleswhich work very well. GraphicsMagick does not seem to have documentation of similar quality.
从功能的角度来看,如果一个库不仅仅是基本的调整大小和裁剪操作需要,我个人更喜欢 ImageMagick,因为它拥有大量、有据可查的、包含数千个示例的图解库,它们运行良好。GraphicsMagick 似乎没有类似质量的文档。
It's also likely that GMagick does not have whatever new features were added to IM since version 5.5.2. It may be worth checking out the ImageMagick change logs whether you're missing out on anything you need.
自 5.5.2 版以来,GMagick 也可能没有向 IM 添加任何新功能。无论您是否遗漏了您需要的任何内容,可能值得查看 ImageMagick 更改日志。
On a highly subjective note, ImageMagick is definitely the more popular and well-known library, and you are likely to find more support, examples and scripts for it. Also I doubt whether the performance differences are going to really make a difference in most use cases - in my experience over the past ten years, IM is not the fastest, but also not the slowest of graphics processing libraries and perfectly suitable for most everyday uses.
从一个高度主观的角度来看,ImageMagick 绝对是更受欢迎和知名的库,您可能会找到更多的支持、示例和脚本。此外,我怀疑性能差异是否真的会在大多数用例中产生影响 - 根据我过去十年的经验,IM 不是最快的,但也不是最慢的图形处理库,非常适合大多数日常使用.
回答by chiborg
What is it you don't like about GD? Is it the API, is it missing features or is it performance?
你不喜欢GD的什么地方?是API,是缺少功能还是性能?
Perhaps you can try the graphics library imagine- it has a nice, clean OOP API and can uses GD, ImageMagick and GraphicsMagick as "backends". This way you can also test which library has the best performance, without having to change your image manipulation code.
也许您可以尝试想象一下图形库——它有一个漂亮、干净的 OOP API,并且可以使用 GD、ImageMagick 和 GraphicsMagick 作为“后端”。通过这种方式,您还可以测试哪个库具有最佳性能,而无需更改您的图像处理代码。