Fastest way for 5 .tif files into 1 .jpg?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
janmartin
Posts: 4
Joined: 2010-10-06T12:53:04-07:00
Authentication code: 8675308

Fastest way for 5 .tif files into 1 .jpg?

Post by janmartin »

Hi all,

there are 5 transparent .tif files of identical size. Each is 25 MB large.
I like to "stack" them into a single same size .jpg

Is there are faster way than this?

convert -size 7500x3750 xc:black \
/tmp/0001000004.tif -composite \
/tmp/0001000000.tif -composite \
/tmp/0001000002.tif -composite \
/tmp/0001000003.tif -composite \
/tmp/0001000001.tif -composite \
-quality 85 /tmp/000100_convert.jpg

Resulting .jpg is 4.5 MB.

I have a 6 core CPU and also a Nvidia GeForcer GTX 550 TI video card.
Is there any program that uses the GPU for this?

Thanks,
Jan
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fastest way for 5 .tif files into 1 .jpg?

Post by fmw42 »

convert -background black \
/tmp/0001000004.tif \
/tmp/0001000000.tif \
/tmp/0001000002.tif \
/tmp/0001000003.tif \
/tmp/0001000001.tif \
-flatten -quality 85 /tmp/000100_convert.jpg

This is simpler, but I cannot say how much faster.

see http://www.imagemagick.org/Usage/layers/
janmartin
Posts: 4
Joined: 2010-10-06T12:53:04-07:00
Authentication code: 8675308

Re: Fastest way for 5 .tif files into 1 .jpg?

Post by janmartin »

I tested with 10 sets of images batch processing.
It's 3% faster.

Any chance to half the time needed?

Thanks,
Jan
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Fastest way for 5 .tif files into 1 .jpg?

Post by fmw42 »

janmartin wrote:I tested with 10 sets of images batch processing.
It's 3% faster.

Any chance to half the time needed?

Thanks,
Jan

I will defer to the IM developers, but I doubt it with IM as it is a general purpose image processor and not designed for optimal speed.

The only way to help as far as I know is to compile IM in Q8 rather than the default Q16 so as to half the memory requirements. You may also want to look at http://www.imagemagick.org/Usage/files/#massive

However, I know that the IM developers have experimented with some minimal GPU processing (convolution as I recall). So hopefully you will hear back from them. They may have some other advice.
janmartin
Posts: 4
Joined: 2010-10-06T12:53:04-07:00
Authentication code: 8675308

Re: Fastest way for 5 .tif files into 1 .jpg?

Post by janmartin »

This is the -debug cache output:
convert -debug cache -background black /tmp/0011000004.tif /tmp/0011000000.tif /tmp/0011000002.tif /tmp/0011000003.tif /tmp/0011000001.tif -flatten -quality 85 /tmp/001100.jpg

2011-09-17T20:24:09+02:00 0:00.010 0.010u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:09+02:00 0:00.010 0.020u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:09+02:00 0:00.010 0.020u 6.5.7 Cache convert[15827]: cache.c/OpenPixelCache/3985/Cache
open /tmp/0011000004.tif[0] (heap memory, 7500x3750 214.6MiB)
2011-09-17T20:24:10+02:00 0:00.560 0.570u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:10+02:00 0:00.560 0.580u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:10+02:00 0:00.560 0.580u 6.5.7 Cache convert[15827]: cache.c/OpenPixelCache/3985/Cache
open /tmp/0011000000.tif[0] (heap memory, 7500x3750 214.6MiB)
2011-09-17T20:24:10+02:00 0:01.100 1.100u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:10+02:00 0:01.100 1.110u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:10+02:00 0:01.100 1.120u 6.5.7 Cache convert[15827]: cache.c/OpenPixelCache/3985/Cache
open /tmp/0011000002.tif[0] (heap memory, 7500x3750 214.6MiB)
2011-09-17T20:24:11+02:00 0:01.640 1.650u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:11+02:00 0:01.640 1.650u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:11+02:00 0:01.640 1.650u 6.5.7 Cache convert[15827]: cache.c/OpenPixelCache/3985/Cache
open /tmp/0011000003.tif[0] (heap memory, 7500x3750 214.6MiB)
2011-09-17T20:24:11+02:00 0:02.160 2.160u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:11+02:00 0:02.160 2.170u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy
2011-09-17T20:24:11+02:00 0:02.160 2.170u 6.5.7 Cache convert[15827]: cache.c/OpenPixelCache/3985/Cache
open /tmp/0011000001.tif[0] (heap memory, 7500x3750 214.6MiB)
2011-09-17T20:24:12+02:00 0:02.710 2.720u 6.5.7 Cache convert[15827]: cache.c/OpenPixelCache/3985/Cache
open /tmp/0011000004.tif[0] (heap memory, 7500x3750 214.6MiB)
2011-09-17T20:24:13+02:00 0:03.930 9.640u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy /tmp/0011000004.tif[0]
2011-09-17T20:24:13+02:00 0:03.950 9.760u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy /tmp/0011000000.tif[0]
2011-09-17T20:24:13+02:00 0:03.970 9.850u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy /tmp/0011000002.tif[0]
2011-09-17T20:24:13+02:00 0:03.980 9.890u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy /tmp/0011000003.tif[0]
2011-09-17T20:24:13+02:00 0:03.990 9.900u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy /tmp/0011000001.tif[0]
2011-09-17T20:24:14+02:00 0:05.160 11.070u 6.5.7 Cache convert[15827]: cache.c/DestroyPixelCache/1550/Cache
destroy /tmp/0011000004.tif[0]

What does it tell?

/tmp is in a RAMDISK anyway.
And the whole Ubuntu 10.04.3. is on a SSD.

Files are 5 times ca. 27 MB, RAM is 16 GB.

Jan
Post Reply