Page 1 of 1

-unsharp - convert time

Posted: 2013-07-19T12:20:40-07:00
by GreenKoopa
holden wrote:I noticed by using -unsharp 0x1 my convert time increased almost twofold in a command like this:

Code: Select all

convert -size 3000x2400 xc:white ( target.jpg -resize 3000x -gravity center +repage  -profile sRGB.icm ) -auto-level -unsharp 0x1 -composite target2.jpg 
Do you have timings for with and without the -unsharp? -unsharp internally contains a -blur, which is an expensive operation. Your radius is small so it shouldn't be too expensive, but your other operations are cheap. Settings (-size, -gravity, +repage, and sometimes -profile) consume virtually no time.

Why are you running -auto-level -unsharp 0x1 on the white canvas? Could they be moved to within the parentheses? Have you considered using -extent, avoiding the need for a white canvas?

Re: -unsharp - convert time

Posted: 2013-07-19T12:27:46-07:00
by holden
Why are you running -auto-level -unsharp 0x1 on the white canvas? Could they be moved to within the parentheses?
That's so obvious I can't believe I didn't try that- in this case the canvas isn't even showing so I didn't consider it.
I start with a white canvas because that is how I am creating borders when I need them, but I may remove it for this case if it creates a significant speedup. Thanks for the reply

Re: -unsharp - convert time

Posted: 2013-07-19T12:38:00-07:00
by GreenKoopa
Simply moving -auto-level -unsharp 0x1 to within the parentheses will halve their time because they are currently being run twice.

I see what you are doing with the white canvas, and that method often makes sense. In your case, -extent may achieve the same output easier and faster.
http://www.imagemagick.org/Usage/crop/#extent
convert target.jpg -resize 3000x -profile sRGB.icm -auto-level -unsharp 0x1 -gravity center -background white -extent 3000x2400 target2.jpg

Re: -unsharp - convert time

Posted: 2013-07-19T12:39:02-07:00
by snibgo
"-auto-level" is also applied to the white background, which is superfluous.

(EDIT: cross-posted.)