www.webdeveloper.com
Results 1 to 5 of 5

Thread: distort text for captcha code

  1. #1
    Join Date
    Mar 2012
    Posts
    22

    distort text for captcha code

    Hi to all!

    I'm searching on the net but 'till now i have no found a solution.
    At the moment i can create a captcha code like this but i don't know how to distort the text, can you help me?

    Thanks

  2. #2
    Join Date
    Mar 2012
    Posts
    22
    I thought that i could distort the text after that it becomes an image.
    I have found this:

    http://php.net/manual/en/imagick.distortimage.php

    it is a class isn't it?

    Some body can help me to use it?

    Thanks

  3. #3
    Join Date
    Jan 2012
    Posts
    31
    I just made some captcha code a few weeks ago. Basically I made a white rectangle background and then on top of it I randomly placed about 50 black rectangles 2 pixels by 20 pixels, for distortion. To add a bit more distortion I randomly picked from about 10 fonts for the letters, and then randomly rotate them between +20 and -20 degrees.

    It took a fair amount of experimentation to figure out each piece of the code but over all not to difficult once you're familiar with rendering images in PHP.

    I can see some uses for distortImage in a captcha but I doubt one needs to go that far to make a good captcha image.

    it is a class isn't it?
    No, distortImage is a method for the Imagick class. You create an image object with Imagick and apply the distortImage method to that image object. If you're not familiar with OOP (Object Oriented Programming) it may be difficult to figure out.

  4. #4
    Join Date
    Mar 2012
    Posts
    22
    Quote Originally Posted by _Krik_:
    then randomly rotate them between +20 and -20 degrees.
    Like did you do it?
    Can you post me an example?

  5. #5
    Join Date
    Mar 2012
    Posts
    22
    An example should be great!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles