compress pictures to fit a file size?
compress pictures to fit a file size?
Hi, as well as it is possible to resize files to fit a width and height, I'd like to be able to recompress JPG files to fit a certain file size if they are bigger than this size, is there an option to do this?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: compress pictures to fit a file size?
see the ">" symbol with -resize widthxheight>
http://www.imagemagick.org/script/comma ... php#resize
http://www.imagemagick.org/script/comma ... php#resize
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: compress pictures to fit a file size?
File compression is a complex issue with so many factors results are not predicatable.
As such your only option is to use trial and error. that is resize and adjust quality until you get the image file size and other attributes you want.
PNG images (which is not lossy) has programs to try to find the minimal file size without image loss. JPEG is very different in this regard.
As such your only option is to use trial and error. that is resize and adjust quality until you get the image file size and other attributes you want.
PNG images (which is not lossy) has programs to try to find the minimal file size without image loss. JPEG is very different in this regard.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/