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.