Page 1 of 1

ImageMagick (Blur) query on win-com-line (test code inside)

Posted: 2007-10-04T05:54:39-07:00
by Ravinderjit S.Sidhu
I am trying (Blur) in windows platfom on command line:
-----------------------------------------------------------------------------------

Code: Select all

convert -size 2100x1200 xc:white ^
  ( -font  arial  -pointsize 105 -fill rgb(0,0,0)   -draw  " text  100,  100 '1.ImageMagick'" -blur 1,1 ) ^
  ( -font  arial  -pointsize 105 -fill rgb(0,0,0)   -draw  " text  100,  300 '2.ImageMagick'" -blur 0,8 ) ^
  ( -font  arial  -pointsize 105 -fill rgb(0,0,0)   -draw  " text  100,  600 '3.ImageMagick'" -blur 0,8 ) ^
  ( -font  arial  -pointsize 105 -fill rgb(0,0,0)   -draw  " text  100,  900 '4.ImageMagick'" -blur 1,1 ) ^
  output.BMP

Output
----------
Output.bmp shows 4 black text lines ("ImageMagicK") at 4 different location (with blur effect).
Line 1 and 4 has same blur attributes "-blur 1,1". (But the effects are different in output. Why?)
Line 2 and 3 has same blur attributes "-blur 0,8". (But the effects are different in output. Why?)
and How i can get the same blur effect on line (1 & 4) and (2 & 3)

(Please suggest me)

Thanks and Regards
Ravinderjit Singh Sidhu

Re: ImageMagick (Blur) query on win-com-line (test code inside)

Posted: 2007-10-04T19:53:56-07:00
by anthony
Blur blurs an image, you only have one image in memory so each
successive blur blurs the same image over and over!

As such older parts get more blurred than the younger parts.

The fact that you used parenthesis without reading, cloning or creating
an image in it is an error, and one that IM should probably report!
as technically you don't have an image inside the parenthesis section
to draw on or blur.

Solution, create separate images to blur.
This is where you really need parenthesis,

Code: Select all

  convert -size 2100x1200 -font  arial  -pointsize 105 -channel RGBA \
    \( xc:none  -fill red   -annotate +100+100 "1.ImageMagick" -blur 0,1 \) \
    \( xc:none  -fill black -annotate +100+300 "1.ImageMagick" -blur 0,8 \) \
    \( xc:none  -fill red   -annotate +100+600 "2.ImageMagick" -blur 0,1 \) \
    \( xc:none  -fill black -annotate +100+900 "2.ImageMagick" -blur 0,8 \) \
    -background white -flatten   win:
As you don't change the font or pointsize settings, you don't need to
repeat them. I also will not be changing the -size setting.

Also I just use 0 for ALL the blur radius so IM can pick something
appropriate. And I told you about -annotate in a previous email.

The final -flatten overlays all the separate images that was generated
on to a white background image.

I suggest you read more on IM Examples. Especially "Basic Usage" "Text
To Image Handling" and "annotating images" in the 'practical' column

http://imagemagick.org/Usage/

NOTE blur is slow, and you can get a vast speed improvement by bluring and overlaying smaller images with a lot less 'blank' areas.

PS: Pick the forum rather than the mail list for future requests for help! I do NOT like repeating myself, and the forum is better for later users searching for similar problems.

Re: ImageMagick (Blur) query on win-com-line (test code inside)

Posted: 2007-10-05T04:40:18-07:00
by Ravinderjit S.Sidhu
Your example helped me, thankyou Anthony.