Yesterday, I shortly discussed a CAPTCHA system for WordPress to stop comment spammers. I also criticized that the CAPTCHA generator is not quite advanced. Well, instead of just talking I decided to improve it, and I think the result is not too bad. You can find the source for the
createCodeImage routine
here. It adds a gradient background and horizontal and vertical lines plus semitransparent rectangles that should pretty much mess up any OCR program's edge detection.