util-captcha
Introduction
A library that generates image CAPTCHAs.
Installation
pip install util-captcha
Usage
from util_captcha import ImageCaptcha
image_captcha = ImageCaptcha()
image_captcha.draw_chars()
image_captcha.draw_noise_curve()
image_captcha.draw_noise_dots()
image_captcha.canvas.save("./examples/captcha-default.png")
image_captcha.redraw()
image_captcha.draw_chars()
image_captcha.draw_noise_dots(333)
image_captcha.canvas.save("./examples/captcha-noise_dots.png")
image_captcha.redraw()
image_captcha.draw_chars("abc", space_evenly=True)
image_captcha.canvas.save("./examples/captcha-space_evenly-True.png")
image_captcha.redraw()
image_captcha.draw_chars("abc", space_evenly=False)
image_captcha.canvas.save("./examples/captcha-space_evenly-False.png")
image_captcha.redraw()
image_captcha.draw_chars("base64")
data = image_captcha.generate_base64()
print(data)