<?php// As a result you will see that 'Open' smoothed the outline, by rounding off any sharp points, and remove any parts that is smaller than the shape used. It will also disconnect or 'open' any thin bridges.$canvas = $this->getCharacterOutline();$kernel = \ImagickKernel::fromBuiltIn(\Imagick::KERNEL_DISK, "6");$canvas->morphology(\Imagick::MORPHOLOGY_OPEN, 1, $kernel);header("Content-Type: image/png"); echo $canvas->getImageBlob();

?>

Exemple #13 Open intensity Imagick::morphology()

<?php// As a result you will see that 'Open' smoothed the outline, by rounding off any sharp points, and remove any parts that is smaller than the shape used. It will also disconnect or 'open' any thin bridges.

<?php//The basic use of the 'Close' method is to reduce or remove any 'holes' or 'gaps' about the size of the kernel 'Structure Element'. That is 'close' parts of the background that are about that size.$canvas = $this->getCharacterOutline();$kernel = \ImagickKernel::fromBuiltIn(\Imagick::KERNEL_DISK, "6");$canvas->morphology(\Imagick::MORPHOLOGY_CLOSE, 1, $kernel);header("Content-Type: image/png"); echo $canvas->getImageBlob();

?>

Exemple #15 Close Intensity Imagick::morphology()

<?php//The basic use of the 'Close' method is to reduce or remove any 'holes' or 'gaps' about the size of the kernel 'Structure Element'. That is 'close' parts of the background that are about that size.$canvas = $this->getCharacter();$kernel = \ImagickKernel::fromBuiltIn(\Imagick::KERNEL_DISK, "6");$canvas->morphology(\Imagick::MORPHOLOGY_CLOSE_INTENSITY, 1, $kernel);header("Content-Type: image/png"); echo $canvas->getImageBlob();

Exemple #19 The 'TopHat' method, or more specifically 'White Top Hat', returns the pixels that were removed by a Opening of the shape, that is the pixels that were removed to round off the points, and the connecting bridged between shapes. Imagick::morphology()

Exemple #20 The 'BottomHat' method, also known as 'Black TopHat' is the pixels that a Closing of the shape adds to the image. That is the pixels that were used to fill in the 'holes', 'gaps', and 'bridges'. Imagick::morphology()

// The thicken morphology doesn't handle small gaps. We close them // with the close morphology.$canvas->morphology(\Imagick::MORPHOLOGY_CLOSE, 1, $diamondKernel);$canvas->morphology(\Imagick::MORPHOLOGY_THICKEN, -1, $convexKernel);$canvas->morphology(\Imagick::MORPHOLOGY_CLOSE, 1, $diamondKernel);