Page 1 of 1
Degrade image quality until a certain size(KB) is reached
Posted: 2010-01-19T02:53:33-07:00
by 6martina6
Hi all,
I need a script to degrade the quality of an image until 50kB of size is reached.
Do you know if it's possible to achieve this using IM?
Thank you very much

Re: Degrade image quality until a certain size(KB) is reached
Posted: 2010-01-19T06:35:43-07:00
by magick
If the image is JPEG, to restrict the maximum file size, use jpeg:extent, for example -define jpeg:extent=400kb. See
http://www.imagemagick.org/script/formats.php and look for the JPEG format. This option is only available in ImageMagick 6.5.8-10 and above.
Re: Degrade image quality until a certain size(KB) is reached
Posted: 2010-01-19T07:33:51-07:00
by 6martina6
This is really usefull!
Thank you very much
Re: Degrade image quality until a certain size(KB) is reached
Posted: 2010-01-19T11:00:54-07:00
by fmw42
see my unix bash script, downsize at link below
Re: Degrade image quality until a certain size(KB) is reached
Posted: 2010-01-20T08:53:48-07:00
by 6martina6
Hi Fred, I know about your downsize script!
It looks great but actually I've to keep the width/height of my jpeg and degrade the quality. -define jpeg:extent is fine for my intent.
Thanks