Using TGA:- with convert is really slow compared to saving the output as a TGA file:
$ time convert.exe test.png test.tga
0.00s user 0.00s system 0% cpu 2.708 total
$ convert.exe test.png TGA:- > test.tga
0.00s user 0.00s system 0% cpu 49.859 total
Both of these commands produces identical output file but the second one (and the one I'm needing when piping image data to an another program) takes ~18x more time and it maxes out one CPU core for the whole ~49.9 seconds. I ran these tests under Cygwin but the same thing happens when running via Windows command prompt. Input file was a random 4000x4000 ~6.6 MB PNG file but I have also tested this with several other files having the same kind of of results.
$ convert.exe -version
Version: ImageMagick 6.9.1-1 Q16 x64 2015-03-20 (ImageMagick-6.9.1-1-Q16-x64-static.exe)
System specs: Windows 7 SP1, i7 4790K, 16GB, SSD
Any help to solve this would be appreciated. Thank you.
Convert very slow when using TGA:- (ImageMagick 6.9.1-1)
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)
I doubt if ImageMagick developers can do much about this (unless IM is doing something weird). Redirecting stdout will always be slower than directly writing to a file.
snibgo's IM pages: im.snibgo.com
Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)
It's not with any other image format tho (same input file than in my first post):snibgo wrote:I doubt if ImageMagick developers can do much about this (unless IM is doing something weird). Redirecting stdout will always be slower than directly writing to a file.
JPEG:
$ convert.exe test.png test.jpg
0.00s user 0.00s system 0% cpu 0.872 total
$ convert.exe test.png JPEG:- > test.jpg
0.00s user 0.00s system 0% cpu 0.660 total
TIF:
$ convert.exe test.png test.tif
0.00s user 0.00s system 0% cpu 7.014 total
$ convert.exe test.png TIF:- > test.tif
0.00s user 0.01s system 0% cpu 6.996 total
BMP:
$ convert.exe test.png test.bmp
0.00s user 0.00s system 0% cpu 0.701 total
$ convert.exe test.png BMP:- > test.bmp
0.00s user 0.00s system 0% cpu 0.662 total
With all these tests the STDOUT version is actually faster, so I don't think the problem is in writing to STDOUT but something that happens before it.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)
Ah, well, that's blown my theory. Sorry. Perhaps a developer can comment.
snibgo's IM pages: im.snibgo.com
Re: Convert very slow when using TGA:- (ImageMagick 6.9.1-1)
We can reproduce the problem you posted and we're testing a patch in ImageMagick 6.9.1-2 Beta, available within a few days. Thanks.