The latter code segment of this captcha is to be placed in a separate file that’s invoked by an img tag in the form function. It uses multiple background files but can be modified to randomly generate a background image. The font is picked randomly from 4 different true type fonts and the size/angle is randomized also.

Show the code