imagemagick使用_使用ImageMagick创建图像缩略图

公羊晟
2023-12-01

imagemagick使用

ImageMagick is, for lack of better term, magic.  You can throw just about anything at it and succeed.  With that in mind, I was recently using Google Page Speed to see how I could improve my website and it occurred to me I wasn't generating thumbnails for my post lists -- I was simply scaling down preview images with CSS.  Certainly not the most efficient technique you've ever heard of.  ImageMagick to the rescue -- now I can parse for images and generate thumbnails to make my site much faster to download!

由于缺乏更好的术语,ImageMagick是魔术。 您几乎可以投掷任何东西,然后成功。 考虑到这一点,我最近正在使用Google Page Speed来查看如何改进网站,但是我发现我没有为我的帖子列表生成缩略图-我只是在使用CSS缩小预览图像。 当然,这不是您听说过的最有效的技术。 ImageMagick可以解救-现在,我可以解析图像并生成缩略图,以使我的网站下载速度更快!

ImageMagick is loaded with options but the syntax to generate a thumbnails is dead easy:

ImageMagick带有选项,但是生成缩略图的语法非常简单:

convert billboard.png -trim -resize 32x32 thumbnail.png

Instead of simply scaling down an image with CSS, I should be generating a thumbnail and serving that up instead.  And since it's so easy to do so, there's really no reason not to!

除了使用CSS缩小图像之外,我还应该生成缩略图并将其投放。 而且因为这样做很容易,所以没有理由不这样做!

翻译自: https://davidwalsh.name/create-image-thumbnails-imagemagick

imagemagick使用

 类似资料: