Generates a custom captcha image using the magick
package. We name this
captcha as R-Captcha.
Arguments
- write_disk
write image to disk? Defaults to
FALSE
.- path
path to save images. Defaults to current directory.
- chars
which chars to generate. Defaults upper/lower case letters and numbers
- n_chars
captcha length. Defaults to 4.
- n_rows, n_cols
image dimensions. Defaults to 60x120 image.
- p_rotate
probability to add rotation. Defaults to 80%.
- p_line
probability to add strike through line. Defaults to 80%.
- p_stroke
probability to add stroke color. Defaults to 30%.
- p_box
probability to add bounding box to text. Defaults to 30%.
- p_implode
probability to add imploding effect. Defaults to 20%.
- p_oilpaint
probability to add oil paint effect. Defaults to 0.
- p_noise
probability to add random noise to image. Defaults to 40%.
- p_lat
probability to add LAT algorithm to image. Defaults to 0.
Value
object of class captcha
, which is a list containing three elements:
image-magick
object and the label.
Examples
# must have ghostscript enabled in ImageMagick
# run check_magick_ghostscript() for details.
if (magick::magick_config()$ghostscript) {
captcha_generate()
captcha_generate(n_chars = 5)
}