The Little Guy Posted March 19, 2011 Share Posted March 19, 2011 I am making an image CAPTCHA, and I want to blur some letters but not others. I have this: shell_exec($opt = "mogrify -blur $blur -font $font -fill '$color' -pointsize $size -draw \"text $txS,$tyP '".$text{$i}."'\" $file"); It is in a loop, and it runs for every letter, setting all the properties, but the first letter is blurred the most and the last letter is blurred the least or not at all. Is there any way I can set a blur for each letter instead of blurring whole image? Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted March 21, 2011 Share Posted March 21, 2011 Probably is but without scouring the manual the method I suggest would be to create x number of images & layer them into 1. Lets say your captcha contains 5 characters. I would create 5 images of lets say 20 x 20 using a different blur level for each. Take the 5 images and layer them onto a new canvas of 100 x 20. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 23, 2011 Author Share Posted March 23, 2011 What I did, was place this in a loop: shell_exec($opt = "convert -size {$canvas_width}x{$this->height} xc:'$this->bgColor' -font $font -fill '$color' -pointsize $size -draw \"gravity center text 0,0'".$text{$i}."'\" -blur 0x$blur $file +append $file"); Quote Link to comment Share on other sites More sharing options...
trq Posted March 23, 2011 Share Posted March 23, 2011 You are aware that a PHP extension exists for imagick? http://au.php.net/imagick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.