9
7
I'm looking for the fastest command-line image converter for Linux which can read a JPEG image, scale it down to at most 1366x768, and write a quality 50 JPEG image. Something like this, but much faster than ImageMagick:
$ convert -resize x768 -quality 50 foo42.jpg foo42.th.jpg
# takes 0m16.713s for my test image set
I've also tried this:
$ <foo42.jpg djpeg | pnmscale -xysize 1366 768 | cjpeg -quality 50 >foo42.th.jpg
# takes 0m12.007s for my test image set, and has lower visual quality than ImageMagick
So I'd like to have a program, preferably written in C, which integrates djpeg, a higher quality version of pnmscale, and cjpeg.
I've just found swiggle (a C program using libjpeg), I've disabled some of it's functionality I don't need in the source code, and I've got:
$ swiggle -f -H 768 .
# takes 0m11.378s for my test image set, yields high quality results
Do you have another suggestion? I guess most image converters use libjpeg, so it would be hard to get much faster results than swiggle.
1I guess the fastest would make use of CUDA or OpenCL (which use the power of your NVidia or AMD based GPU). I think OpenCV now uses CUDA in parts. You might be able to whip something up if you're handy with c – Matt H – 2011-02-24T02:44:36.477
I agree with Matt. If those are huge images (and if it takes 12 seconds then I guess they are not small), then CUDA/OpenCL would do the job. Or get a better PC. – Apache – 2011-02-24T06:15:58.747
The images are not too large (4000x3000 is the maximum) -- conversion takes 12 seconds for an image set of several dozen images. – pts – 2011-03-11T10:39:37.140