CropEntropy
This class finds the a position in the picture with the most energy in it.
Energy is in this case calculated by this
getSpecialOffset(\Imagick $original, int $targetWidth, int $targetHeight) : array
\Imagick
int
int
array
getEntropyOffsets(\Imagick $original, int $targetWidth, int $targetHeight) : array
\Imagick
int
int
array
getOffsetFromEntropy(\Imagick $originalImage, $targetWidth, int $targetHeight) : array
\Imagick
int
array
slice(mixed $image, mixed $originalSize, mixed $targetSize, mixed $axis) : void
access |
protected |
---|---|
mixed
mixed
mixed
mixed
h=horizontal, v = vertical
getLimit(string $position, int $offset) : int|null
access |
protected |
---|---|
string
(top|bottom|left|right)
int
int|null
getSafeZoneList() : array
access |
protected |
---|---|
array
grayscaleEntropy(\Imagick $image) : float
A higher value of entropy means more noise / liveliness / color / business
see | |
---|---|
\Imagick
float
colorEntropy(\Imagick $image) : float
If the source image is in color we need to transform RGB into a grayscale image so we can calculate the entropy more performant.
\Imagick
float
start()
mark() : string
string
__construct(string $imagePath)
string
area(\Imagick $image) : int
\Imagick
int
resizeAndCrop(int $targetWidth, int $targetHeight) : boolean|\Imagick
int
int
boolean|\Imagick
getSafeResizeOffset(\Imagick $image, int $targetWidth, int $targetHeight) : array
\Imagick
int
int
array
rgb2bw(int $r, int $g, int $b) : int
see | |
---|---|
int
int
int
int
getEntropy(array $histogram, int $area) : float
array
int
float
start_time
var | |
---|---|
originalImage
var | |
---|---|