Skip to main content

Dynamically generated, AI-resistant captcha images

Project description

color-captcha

Dynamically generated, AI-resistant captcha images.

captcha

Can you tell what time it is? AI can't.

Features:

  • dynamically generated images
  • rgb and grayscale color mode
  • 12-hour and 24-hour clock mode
  • custom colors

Installation

pip install color-captcha

Usage

from color_captcha import ClockCaptcha

captcha = ClockCaptcha()
print(captcha.value)

captcha.verify('0645') # True/False
captcha.save_image('image.png')

# generate new captcha
captcha.generate_new()

Choose between color_mode='rgb' (color-captcha.png) or 'grayscale' (grayscale-captcha.png).

Pick between a 12-hour or a 24-hour clock_mode.

from color_captcha import ClockCaptcha

captcha = ClockCaptcha(clock_mode=12)

Image size can be changed with relative size parameter. Here are corresponding pixel values.

size width height
1 190 65
2 380 130
3 570 195
4 760 260
... ... ...

Change colors globally:

from color_captcha import ClockCaptcha
ClockCaptcha.set_colors([
    '#FFFFFF',
    '#000000',
    '#999999'
])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

color_captcha-0.1.4.tar.gz (23.9 kB view hashes)

Uploaded Source

Built Distribution

color_captcha-0.1.4-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page