I'm running the following to first pad an image and then resize it to 64x64:
convert img.jpg -gravity center -background white -extent "$extent_factor"x"$extent_factor" -resize 64x64 img.jpg
Here extent_factor is the height or width of the image (whichever is larger).
Resizing each image takes ~5 seconds this way.
I have close to 35000 images which need to be converted this way. So, it looks like it's going to take close to 48 hrs.
Is there anything I can do to speed it up?
Running "imagemagick -version" gives me:
Version: ImageMagick 6.8.9-8 Q16 x86_64 2014-10-09 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC HDRI Modules OpenCL OpenMP
Delegates: bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms lqr ltdl lzma pangocairo png ps rsvg tiff webp wmf x xml zlib
Any help in speeding this up will be appreciated.
Thanks
Speed up convert for padding and resizing
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Speed up convert for padding and resizing
"-scale" is faster than "-resize", and for such small pictures I doubt you would see the difference.
Changing the size first, then using extent, likewise.
EDIT to add: Q8 may be faster than Q16, but not by much.
Changing the size first, then using extent, likewise.
EDIT to add: Q8 may be faster than Q16, but not by much.
snibgo's IM pages: im.snibgo.com
Re: Speed up convert for padding and resizing
Lightning fast:
- convert -define jpeg:size=64x64 image.jpg -resize 64x64 -background white -extent 64x64 framed.jpg