public function opacity(&$image, $opacity)
    {

        if ($image->isAnimated()) { // Ignore animated GIF for now
            return $this;
        }

        // Bounds checks
        $opacity = ($opacity > 1) ? 1 : $opacity;
        $opacity = ($opacity < 0) ? 0 : $opacity;

        $image->getCore()->setImageOpacity($opacity);

        return $this;
    }
public function opacity(&$image, $opacity)
    {

        if ($image->isAnimated()) { // Ignore animated GIF for now
            return $this;
        }

        // Bounds checks
        $opacity = ($opacity > 1) ? 1 : $opacity;
        $opacity = ($opacity < 0) ? 0 : $opacity;

        $image->getCore()->setImageOpacity($opacity);

        return $this;
    }
public function opacity ( & $ image , $ opacity ) { if ( $ image -> isAnimated ( ) ) { // Ignore animated GIF for now return $ this ; } // Bounds checks $ opacity = ( $ opacity > 1 ) ? 1 : $ opacity ; $ opacity = ( $ opacity < 0 ) ? 0 : $ opacity ; $ image -> getCore ( ) -> setImageOpacity ( $ opacity ) ; return $ this ; }
Sets the image to the specified opacity level where 1.0 is fully opaque and 0.0 is fully transparent.

@param Image $image
@param float $opacity

@return self
@throws \Exception
Sets the image to the specified opacity level where 1 . 0 is fully opaque and 0 . 0 is fully transparent .