I have pictures between 3 and 30 MB. All this pictures must be convert to the same output filesize 2MB but with the original geometry size.
I try this with -quality, resize etc., but I get different output filesizes or samler geometry.
I need help.....
output file with specified filesize + original geometry?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: output file with specified filesize + original geometry?
What format are your output images? What platform are you using?
Basically, other than your playing with -quality, there is no way to keep the image dimensions the same and get a specific file size as far a I know in IM.
Basically, other than your playing with -quality, there is no way to keep the image dimensions the same and get a specific file size as far a I know in IM.
Re: output file with specified filesize + original geometry?
The Source image file is jpg and the Output file jpg, too.
I use an Linux System (debian, Suse).
I also make Tests with -quality, but the output size e.g. from a 8 MB file is sometimes 2,3 MB and sometimes 5 MB, with the Same quality Percent size.
I use an Linux System (debian, Suse).
I also make Tests with -quality, but the output size e.g. from a 8 MB file is sometimes 2,3 MB and sometimes 5 MB, with the Same quality Percent size.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: output file with specified filesize + original geometry?
As I said you have to use trial an error to get the specified file size by changing -quality as the compression will be image dependent. There is no simple recipe to get a specified file size via -quality in IM.
I am not sure how PS does jpg compression to a given file size for web output.
The only way I know to do it is to iterate on the -quality until you get what you want for the filesize.
I am not sure how PS does jpg compression to a given file size for web output.
The only way I know to do it is to iterate on the -quality until you get what you want for the filesize.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: output file with specified filesize + original geometry?
ImageMagick JPG coder can do that 'trial and error' for you.
See IM Examples, Common image file Formats, JPEG, Writing options
and specifically the -define jpeg:extent={size} option
http://www.imagemagick.org/Usage/formats/#jpg_write
See IM Examples, Common image file Formats, JPEG, Writing options
and specifically the -define jpeg:extent={size} option
http://www.imagemagick.org/Usage/formats/#jpg_write
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: output file with specified filesize + original geometry?
I stand corrected. Neat. I learned something new today.
Re: output file with specified filesize + original geometry?
Thank you! It works fine!