draw text slow as _www

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
joneb
Posts: 1
Joined: 2014-11-20T17:13:19-07:00
Authentication code: 6789

draw text slow as _www

Post by joneb »

I was doing some apache cgi-bin image manipulations in python via shell. It was extremely slow.
Then I isolated the issue to drawing text with convert as the user _www.

I am not sure where to go from here. What is special about _www using draw text?

$ date;sudo -H -u _www /sw/bin/convert image.tiff -format png -scale 600 -draw "text 25,60 'Magick'" -depth 8 /tmp/tmp.png;date
Thu Nov 20 16:06:39 PST 2014
Thu Nov 20 16:07:36 PST 2014 <----------------

In the process viewer, "top", convert is running 89-100% for that duration.

In comparison:
Drawing no text
$ date;sudo -H -u _www /sw/bin/convert image.tiff -format png -scale 600 -draw "text 25,60 ''" -depth 8 /tmp/tmp.png;date
Thu Nov 20 16:07:46 PST 2014
Thu Nov 20 16:07:46 PST 2014

Drawing text as normal user or su
$ date;sudo /sw/bin/convert image.tiff -draw "text 25,60 'x'" /tmp/tmp.tiff;date
Thu Nov 20 16:09:46 PST 2014
Thu Nov 20 16:09:47 PST 2014

Version: ImageMagick 6.5.8-2 2011-01-05 Q16
Features: HDRI OpenMP
Mac OSX 10.8.5
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: draw text slow as _www

Post by fmw42 »

Version 6.5.8-2 in extremely ancient (over 300 versions old). Many improvements have been made in functionality and speed. Try upgrading to the current version 6.9.0.0. It may also run faster if you do not use HDRI.

Also I think -format png can be removed. IM knows the format from your suffix. But I could be wrong about that when using such an old version of IM.

If you can upload your tiff image to some free hosting service such as dropbox.com and post the URL here, some one can test on a current version of IM and give you the timing results.

I do not know much about how the "user" affects the running of IM. So one of the developers will have to respond to that.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: draw text slow as _www

Post by snibgo »

How many pixels does image.tiff have? Perhaps user _www has a small restriction on memory usage, and the draw text image uses more memory, so the image data is moved to disk.
snibgo's IM pages: im.snibgo.com
Post Reply