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.