Easy-to-use Java CAPTCHA image generation API used by Sonar
Releases | Issues | Pull Requests | Discord | License
CaptchaPreparer.java (using custom filters)
import java.awt.image.BufferedImage;
// Creates a CAPTCHA generator instance
simpleCaptchaGenerator = new SimpleCaptchaGenerator(width, height, null);
// You can also use a custom background image
simpleCaptchaGenerator = new SimpleCaptchaGenerator(width, height, new File("background.png"));
// Creates a BufferedImage with the code 69420
bufferedImage = simpleCaptchaGenerator.createImage(new char[]{'6', '9', '4', '2', '0'});
// You can also use custom effects and filters
bufferedImage = simpleCaptchaGenerator.createImage(/* ... */, new BumpFilter(), new SmearFilter());
capja is licensed under the GNU General Public License 3.0.
- Special thanks to jhlabs for creating awesome image filters