https://github.com/yiding-he/hydrogen-captcha
Captha Image Generator
https://github.com/yiding-he/hydrogen-captcha
captcha-image java java2d
Last synced: about 1 month ago
JSON representation
Captha Image Generator
- Host: GitHub
- URL: https://github.com/yiding-he/hydrogen-captcha
- Owner: yiding-he
- License: apache-2.0
- Created: 2019-12-31T10:04:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T18:33:15.000Z (over 4 years ago)
- Last Synced: 2024-10-29T09:15:59.656Z (7 months ago)
- Topics: captcha-image, java, java2d
- Language: Java
- Homepage:
- Size: 526 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hydrogen-captcha
This is a customizable captcha image generator.
## Usage
```java
CaptchaGenerator captchaGenerator = new CaptchaGenerator();
BufferedImage image = captchaGenerator.generate(200, 50, "ABCDEF");
```Load fonts from a directory and `CaptchaGenerator` will use them:
```java
FontRepository.loadFonts("./sample-fonts/");
```Setup a background:
```java
captchaGenerator.setBackground(new CirclesBackground());
// or
captchaGenerator.setBackground(new GradientBackground(true));
```And you can add effects on both background and char images:
```java
captchaGenerator.addBackgroundFilter(new CrossFilter(10, 1, true));
captchaGenerator.addCharImageFilter(new CrossFilter(10, 1, true));
```And you can also create your own effects!
## Sample images

