squeezr/lib/Tollwerk/Squeezr/Image.php
/**
     * Sharpen an image
     *
     * @param resource $image Image resource
     * @param int $width Original image width
     * @param int $targetWidth Downsampled image width
     * @return void
     */
Sharpen an image
@param resource $image Image resource
@param int $width Original image width
@param int $targetWidth Downsampled image width
@return void
Sharpen an image @param resource $image Image resource @param int $width Original image width @param int $targetWidth Downsampled image width @return void
protected static function _sharpenImage($image, $width, $targetWidth)
    {
        if (!!SQUEEZR_IMAGE_SHARPEN && function_exists('imageconvolution')) {
            $intFinal = $targetWidth * (750.0 / $width);
            $intA = 52;
            $intB = -0.27810650887573124;
            $intC = .00047337278106508946;
            $intRes = $intA + $intB * $intFinal + $intC * $intFinal * $intFinal;
            $intSharpness = max(round($intRes), 0);
            $arrMatrix = array(
                array(-1, -2, -1),
                array(-2, $intSharpness + 12, -2),
                array(-1, -2, -1)
            );
            imageconvolution($image, $arrMatrix, $intSharpness, 0);
        }
    }
protected static function _sharpenImage ( $ image , $ width , $ targetWidth ) { if ( ! ! SQUEEZR_IMAGE_SHARPEN && function_exists ( 'imageconvolution' ) ) { $ intFinal = $ targetWidth * ( 750.0 / $ width ) ; $ intA = 52 ; $ intB = - 0.27810650887573124 ; $ intC = .00047337278106508946 ; $ intRes = $ intA + $ intB * $ intFinal + $ intC * $ intFinal * $ intFinal ; $ intSharpness = max ( round ( $ intRes ) , 0 ) ; $ arrMatrix = array ( array ( - 1 , - 2 , - 1 ) , array ( - 2 , $ intSharpness + 12 , - 2 ) , array ( - 1 , - 2 , - 1 ) ) ; imageconvolution ( $ image , $ arrMatrix , $ intSharpness , 0 ) ; } }
Sharpen an image
 @param resource $image Image resource
 @param int $width Original image width
 @param int $targetWidth Downsampled image width
 @return void
Sharpen an image @param resource $image Image resource @param int $width Original image width @param int $targetWidth Downsampled image width @return void
// Sharpen image if possible and requested