-unsharp - convert time

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
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

-unsharp - convert time

Post 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?
holden
Posts: 79
Joined: 2013-02-07T08:22:57-07:00
Authentication code: 6789

Re: -unsharp - convert time

Post 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
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: -unsharp - convert time

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -unsharp - convert time

Post by snibgo »

"-auto-level" is also applied to the white background, which is superfluous.

(EDIT: cross-posted.)
snibgo's IM pages: im.snibgo.com
Post Reply