Resize images to a certain size?
Resize images to a certain size?
Will ImageMagick be able to resize large amount of images to a certain size ( Eg; 40 KB) using optimization compression while keeping the image height and width,however if it's unable to do so , certain dpi resizing will happen which then allows it to reach target size?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Resize images to a certain size?
You would need a script for that.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Resize images to a certain size?
That is possible with JPG output. See -define jpeg:extent={size} at https://imagemagick.org/Usage/formats/#jpg_write
DPI only affects print size, not raster image size unless you change width and height accordingly.
DPI only affects print size, not raster image size unless you change width and height accordingly.
Re: Resize images to a certain size?
Just clarifying, so does the width/height change if I were to use the cmd -define jpeg:extent={size} or something else happens?
Sorry if im being confusing and thank you for replying.
Sorry if im being confusing and thank you for replying.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Resize images to a certain size?
The width and height do not change. That define will tell imagemagick the size you want and it will iterate changing the quality value (compression) until it reaches that image size. But it is limited to JPG output only.