Page 1 of 1

Is slow convert text-to-image command using label normal?

Posted: 2017-02-14T19:41:36-07:00
by cyhlau
I am trying to use the following convert command to convert text into image. But I found it having a slow performance in my machine.
Comparing with converting first page of pdf to image, and even assembling 4 big images to an animated GIF, their time is about the same.
So I would like to know if this operation is supposed to be slow in nature?

Note: I have read through some other threads on the forum and limit the thread to 1 to avoid the possible MP library problem. But the time is is just a few ms different so I assume my version of ImageMagick is not be affected by the MP library problem.

Code: Select all

convert -background white -fill black \
                    -font Times-Roman -pointsize 24 \
                    -limit thread 1 \
                    "label:This is a simple plain text file. No fancy.
This is the second line of the text file.
Third
Fourth
Fifth
and more and more..."\
                    jpeg:/tmp/PCkcL7"

Re: Is slow convert text-to-image command using label normal?

Posted: 2017-02-14T20:10:26-07:00
by fmw42
The first time you convert text, IM seems to be slow due to loading of the delegate it uses. After than, the times should improve.

What is your timing?

For example when I run your command the first time:

Code: Select all

time convert -background white -fill black \
-font Times-Roman -pointsize 24 \
-limit thread 1 \
"label:This is a simple plain text file. No fancy.
This is the second line of the text file.
Third
Fourth
Fifth
and more and more..." \
tmp.png
real 0m1.057s
user 0m0.087s
sys 0m0.059s

But the next time:

real 0m0.102s
user 0m0.068s
sys 0m0.022s


So about 10 times faster.