alexantd
alexantd

Reputation: 3605

Slow performance cropping large JPEG2000 images with ImageMagick/Jasper

I have a 4000x3000, 3.7MB JPEG2000 file that I'm trying to process into cropped tiles. I do this with a command like:

convert 486.jp2 -crop 256x256+0+0 -format jpg 486_crop.jpg

This command takes 5 seconds to run on a current-model Mac Pro. ImageMagick is using the Jasper library, which I've read is very slow. I just want to make sure I'm not botching the command somehow before I abandon ImageMagick in this application.

Upvotes: 2

Views: 1719

Answers (2)

sanmai
sanmai

Reputation: 30911

On a year old Mac mini (2.53 C2D):

$ ls -hn test.jp2
-rw-r--r--  1 501  20    10M Aug 12 23:40 test.jp2

$ time convert test.jp2 -crop 256x256 -format jpg test/%d.jpg

real    0m3.971s
user    0m3.383s
sys     0m0.535s

On a current-model quad-core Mac Pro it should run no slower.

I am using a stock version of ImageMagick from ports:

$ convert -version
Version: ImageMagick 6.6.3-0 2010-08-31 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP OpenCL

Also it is same slow when tiling PNG or plain JPEG. Seems to me that JPEG2000 isn't the issue here.

Upvotes: 0

Serabe
Serabe

Reputation: 3924

ImageMagick has poor perf (pretty good results though). You can consider GraphicsMagick instead. A few interesting benchmarks (there is one for the crop option): GraphicsMagick 1.3.8 vs ImageMagick 6.5.8-10 Benchmark Report

Upvotes: 2

Related Questions