Viewing 4 replies - 1 through 4 (of 4 total)
  • I think it is not possible to make the background transparent. But it sounds interesting.

    Thread Starter ka81

    (@ka81)

    well, the generated image with text – is PNG, so i guess transparent may be possible somehow?…

    yes, maybe so if you can edit plugin’s codes. please tell us when you succeed.

    I wanted to do this as well. A quick google search of gd commands got me to this page: https://www.php.net/imagecolortransparent

    In really-simple-captcha.php add the command
    imagecolortransparent( $im, $bg );
    after line 95 so the block looks like this

    if ( $im = imagecreatetruecolor( $this->img_size[0], $this->img_size[1] ) ) {
    $bg = imagecolorallocate( $im, $this->bg[0], $this->bg[1], $this->bg[2] );
    $fg = imagecolorallocate( $im, $this->fg[0], $this->fg[1], $this->fg[2] );
    
    /* Added to make png background transparent */
    imagecolortransparent( $im, $bg );
    
    imagefill( $im, 0, 0, $bg );

    Did the trick for me.
    Then style the box to use a patterned background and you’ve got one of those annoying-to-read captcha boxes.
    Keep in mind, the transparent color is indexed, so make sure it’s not the same as the foreground color. If you want white lettering make the background color something other than white.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Really Simple CAPTCHA] background transparent for image’ is closed to new replies.