Not able to resize images to <150KB file-size
Posted: 2012-12-05T01:55:51-07:00
Hi,
I am using imagemagick in windows 7. I need to resize and then save a bunch of images such that the resulting file size is <150KB.
I am using a batch script to do the same. Here is my code -
@for %%f in (*.jpg) do (
convert %%f -resize 1000 %%~nf-1000.jpg
convert %%~nf-1000.jpg -define jpeg:extent=150kb %%~nf-150.jpg
)
Basically, I am taking every .jpg file and resizing to width=1000. Then I am using '-define jpeg:extent=150kb' to compress the image to filesize <150Kb.
The original images are of 4-6MB file size.
Using the above commands, results in an image that is 2-3MB in size. Basically the second command above is not having any effect.
Can anyone help me in figuring out the mistake??
TIA
I am using imagemagick in windows 7. I need to resize and then save a bunch of images such that the resulting file size is <150KB.
I am using a batch script to do the same. Here is my code -
@for %%f in (*.jpg) do (
convert %%f -resize 1000 %%~nf-1000.jpg
convert %%~nf-1000.jpg -define jpeg:extent=150kb %%~nf-150.jpg
)
Basically, I am taking every .jpg file and resizing to width=1000. Then I am using '-define jpeg:extent=150kb' to compress the image to filesize <150Kb.
The original images are of 4-6MB file size.
Using the above commands, results in an image that is 2-3MB in size. Basically the second command above is not having any effect.
Can anyone help me in figuring out the mistake??
TIA