protected function getEntropyOffsets(\Imagick $original, $targetWidth, $targetHeight)
    {
        $measureImage = clone($original);
        // Enhance edges
        $measureImage->edgeimage(1);
        // Turn image into a grayscale
        $measureImage->modulateImage(100, 0, 100);
        // Turn everything darker than this to pitch black
        $measureImage->blackThresholdImage("#070707");
        // Get the calculated offset for cropping
        return $this->getOffsetFromEntropy($measureImage, $targetWidth, $targetHeight);
    }
protected function getEntropyOffsets(\Imagick $original, $targetWidth, $targetHeight)
    {
        $measureImage = clone($original);
        // Enhance edges
        $measureImage->edgeimage(1);
        // Turn image into a grayscale
        $measureImage->modulateImage(100, 0, 100);
        // Turn everything darker than this to pitch black
        $measureImage->blackThresholdImage("#070707");
        // Get the calculated offset for cropping
        return $this->getOffsetFromEntropy($measureImage, $targetWidth, $targetHeight);
    }
protected function getEntropyOffsets ( \ Imagick $ original , $ targetWidth , $ targetHeight ) { $ measureImage = clone ( $ original ) ; // Enhance edges $ measureImage -> edgeimage ( 1 ) ; // Turn image into a grayscale $ measureImage -> modulateImage ( 100 , 0 , 100 ) ; // Turn everything darker than this to pitch black $ measureImage -> blackThresholdImage ( "#070707" ) ; // Get the calculated offset for cropping return $ this -> getOffsetFromEntropy ( $ measureImage , $ targetWidth , $ targetHeight ) ; }
Get the topleftX and topleftY that will can be passed to a cropping method.

@param  \Imagick $original
@param  int      $targetWidth
@param  int      $targetHeight
@return array
Get the topleftX and topleftY that will can be passed to a cropping method .