squeezr/lib/Tollwerk/Squeezr/Image.php
/**
     * Enable transparency on an image resource
     *
     * @param resource $image Image resource
     * @param array $transparentColor Transparent color
     * @return void
     */
Enable transparency on an image resource
@param resource $image Image resource
@param array $transparentColor Transparent color
@return void
Enable transparency on an image resource @param resource $image Image resource @param array $transparentColor Transparent color @return void
protected static function _enableTranparency($image, array $transparentColor = null)
    {
        if ($transparentColor === null) {
            $transparentColor = array('red' => 0, 'green' => 0, 'blue' => 0, 'alpha' => 127);
        }
        $targetTransparent = imagecolorallocatealpha($image, $transparentColor['red'], $transparentColor['green'],
            $transparentColor['blue'], $transparentColor['alpha']);
        imagecolortransparent($image, $targetTransparent);
        imageFill($image, 0, 0, $targetTransparent);
        imagealphablending($image, false);
        imagesavealpha($image, true);
    }
protected static function _enableTranparency ( $ image , array $ transparentColor = null ) { if ( $ transparentColor === null ) { $ transparentColor = array ( 'red' => 0 , 'green' => 0 , 'blue' => 0 , 'alpha' => 127 ) ; } $ targetTransparent = imagecolorallocatealpha ( $ image , $ transparentColor [ 'red' ] , $ transparentColor [ 'green' ] , $ transparentColor [ 'blue' ] , $ transparentColor [ 'alpha' ] ) ; imagecolortransparent ( $ image , $ targetTransparent ) ; imageFill ( $ image , 0 , 0 , $ targetTransparent ) ; imagealphablending ( $ image , false ) ; imagesavealpha ( $ image , true ) ; }
Enable transparency on an image resource
 @param resource $image Image resource
 @param array $transparentColor Transparent color
 @return void
Enable transparency on an image resource @param resource $image Image resource @param array $transparentColor Transparent color @return void