将图像调整为指定大小(< 100 kB) [英] Resize image to specified size (<100 kB)
本文介绍了将图像调整为指定大小(< 100 kB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将上传的图像调整为最大大小100 kB.有可能吗?
I need resize uploaded image to maximum size 100 kB. Is it possible ?
例如:尺寸为1200x600的image1.jpg的大小为280kB,我需要将其大小调整为< 100kB.
For example : image1.jpg with dimensions 1200x600 has 280kB and I need resize it to <100kB.
推荐答案
ImageMagick的最新版本允许您指定JPEG文件的最大大小,如下所示:
Recent versions of ImageMagick allow you to specify the maximum size for a JPEG file like this:
convert input.jpg -define jpeg:extent=100kb output.jpg
尽最大努力使输出文件低于100kB.
which does its best to get the output file under 100kB.
这篇关于将图像调整为指定大小(< 100 kB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文