Imagick::transparentPaintImage

Paints pixels transparent

&reftitle.description; public `bool` `Imagick::transparentPaintImage` `mixed` `target` `float` `alpha` `float` `fuzz` `bool` `invert`

Paints pixels matching the target color transparent. &imagick.method.available.0x638;

&reftitle.parameters;

`target`

- The target color to paint

`alpha`

- &imagick.parameter.alpha;

`fuzz`

- &imagick.parameter.fuzz;

`invert`

- If &true; paints any pixel that does not match the target color.

&reftitle.returnvalues;

&imagick.return.success;

&reftitle.examples;

### `Imagick::transparentPaintImage`

    <?php
    function transparentPaintImage($color, $alpha, $fuzz) {
        $imagick = new \Imagick(realpath("images/BlueScreen.jpg"));

        //Need to be in a format that supports transparency
        $imagick->setimageformat('png');

        $imagick->transparentPaintImage(
            $color, $alpha, $fuzz * \Imagick::getQuantum(), false
        );

        //Not required, but helps tidy up left over pixels
        $imagick->despeckleimage();

        header("Content-Type: image/png");
        echo $imagick->getImageBlob();
    }

    ?>