Hello,
I m a new user of ImageMagick .I need to add text to image at the bottom.
So i m using the following command :
convert inputTiffName -gravity SouthEast -font helvetica -pointsize 41 -annotate 'Stamp On Tiff' OutputTiffName
I have used the sh file to apply stamp on all tiffs in the given folder
Stamping.sh
date >> StampingLog.txt
for i in `ls`;do convert /home/dev/Aparna/SinglePage_Tiff_Out_GS/$i -gravity SouthEast -font helvetica -pointsize 41 -annotate 'Stamp On Tiff' /home/dev/Aparna/Stamped_Without_Resize_Tiff/$i; done
date >> StampingLog.txt
But the process is very slow . It is taking 2 hrs and 30 min to apply stamp on 1000 tiffs where as other stamping tool is taking just a 10 min for the same process .
Do i need to use any flags to improve the performance ?
Please guide me in the right direction .
Regards
Aparna
Annotation on tiff is very slow
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Annotation on tiff is very slow
IM is a general-purpose tool, and can be slower than more specialist single-purpose programs. But 9 seconds per conversion is very slow. How large are the images? Can you post one? What version IM do you use?
snibgo's IM pages: im.snibgo.com
Re: Annotation on tiff is very slow
Thanks for the reply.
I m using ImageMagick 6.6.1-7.
Images are tiffs (-sDEVICE=tiffg4) created from PDF with 300 dpi , so its pixel size is 2550x3300 .
I have tried -threshold 50% option.
Adding the option -threshold 50% the process is much faster and the result image is quite good.
Before adding threshold - Time required - 2 hrs and 30 min
After adding threshold - Time required - 14 min
Do anybody have any idea what happens with image when we set threshold value ?
Do it degrade the image quality ?
If not can i reduce the threshold value to get more faster response ?
Thanks in advance .
I m using ImageMagick 6.6.1-7.
Images are tiffs (-sDEVICE=tiffg4) created from PDF with 300 dpi , so its pixel size is 2550x3300 .
I have tried -threshold 50% option.
Adding the option -threshold 50% the process is much faster and the result image is quite good.
Before adding threshold - Time required - 2 hrs and 30 min
After adding threshold - Time required - 14 min
Do anybody have any idea what happens with image when we set threshold value ?
Do it degrade the image quality ?
If not can i reduce the threshold value to get more faster response ?
Thanks in advance .
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Annotation on tiff is very slow
On my Windows7 laptop, IM 6.6.0-8, where red.tif is 2550x3300, this takes 0.08 seconds (so 1 minute 20 seconds for 1000):
It is difficult to comment further unless you provide a sample that is taking 9 seconds.
Code: Select all
convert red.tif -gravity SouthEast -font c:\windows\fonts\arial.ttf -pointsize 41 -annotate 0 "Stamp on tiff" reda.tif
snibgo's IM pages: im.snibgo.com
Re: Annotation on tiff is very slow
Thank you so much for replies.
I m working on Open SUSE 11.2 .
Time required :
time convert ./1.tiff -gravity SouthEast -font helvetica -pointsize 41 -annotate 0+2 "Stamp on tiff" ./2.tiff
real 0m8.176s
user 0m10.829s
sys 0m0.472s
Here is the sample file :
http://docs.google.com/leaf?id=0B7LlXii ... NDc1&hl=en
As soon as i used this flag -threshold 50% it increase the performance tremendously .
Do you have any idea What happens with image when flag -threshold 50% is used ?
I m working on Open SUSE 11.2 .
Time required :
time convert ./1.tiff -gravity SouthEast -font helvetica -pointsize 41 -annotate 0+2 "Stamp on tiff" ./2.tiff
real 0m8.176s
user 0m10.829s
sys 0m0.472s
Here is the sample file :
http://docs.google.com/leaf?id=0B7LlXii ... NDc1&hl=en
As soon as i used this flag -threshold 50% it increase the performance tremendously .
Do you have any idea What happens with image when flag -threshold 50% is used ?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Annotation on tiff is very slow
This is very strange. On IM 6.6.0-8 Windows 7:
sample.tiff is bilevel. Output 2b.tiff is bilevel, which is reasonable. But output 2a.tiff is also bilevel, where I would expect grayscale anti-aliasing around the characters.
I would expect the thresholding to remove the anti-aliasing, so reducing the image quality slightly, and taking some time to do so. But the two outputs are almost identical and the thresholding dramatically improves performance.
The workaround for Aparna More is, of course, to use thresholding.
Perhaps someone with more knowledge about internals could comment.
Code: Select all
convert sample.tiff -gravity SouthEast -font c:\windows\fonts\arial.ttf -pointsize 41 -annotate 0+2 "Stamp on tiff" 2a.tiff <-- takes about 12 seconds
convert sample.tiff -gravity SouthEast -font c:\windows\fonts\arial.ttf -pointsize 41 -annotate 0+2 "Stamp on tiff" -threshold 50% 2b.tiff <-- takes less than 1 second
I would expect the thresholding to remove the anti-aliasing, so reducing the image quality slightly, and taking some time to do so. But the two outputs are almost identical and the thresholding dramatically improves performance.
The workaround for Aparna More is, of course, to use thresholding.
Perhaps someone with more knowledge about internals could comment.
snibgo's IM pages: im.snibgo.com