Skip to content

yiding-he/hydrogen-captcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hydrogen-captcha

This is a customizable captcha image generator.

Usage

CaptchaGenerator captchaGenerator = new CaptchaGenerator();
BufferedImage image = captchaGenerator.generate(200, 50, "ABCDEF");

Load fonts from a directory and CaptchaGenerator will use them:

FontRepository.loadFonts("./sample-fonts/");

Setup a background:

captchaGenerator.setBackground(new CirclesBackground());
// or
captchaGenerator.setBackground(new GradientBackground(true));

And you can add effects on both background and char images:

captchaGenerator.addBackgroundFilter(new CrossFilter(10, 1, true));
captchaGenerator.addCharImageFilter(new CrossFilter(10, 1, true));

And you can also create your own effects!

Sample images

screenshot

hDGRSI8Ov0

Releases

No releases published

Packages

No packages published

Languages