Documentación offline PHP master

ImagickKernel::addUnityKernel

master Ver versión oficial en línea Licencia CC-BY-3.0Descargado el 2026-08-02

En esta página

ImagickKernel::addUnityKernel

Añade un núcleo Unity a la lista de núcleos

Descripción#

public ImagickKernel::addUnityKernel(float $scale): void
```php

Añade una cantidad dada del núcleo de convolución 'Unity' al núcleo de convolución pre-escalado y normalizado dado. Esto tiene como efecto añadir esta cantidad de la imagen original en el núcleo de convolución resultante. El efecto resultante es convertir los núcleos definidos en desenfoques suaves mezclados, en núcleos no afilados o en núcleos de nitidez.

## Parámetros

Esta función no contiene ningún parámetro.

## Valores devueltos

## Ejemplos

`ImagickKernel::addUnityKernel`
"; foreach ($matrix as $row) { $output .= ""; foreach ($row as $cell) { $output .= ""; if ($cell === false) { $output .= "false"; } else { $output .= round($cell, 3); } $output .= ""; } $output .= ""; } $output .= ""; return $output; } $matrix = [ [-1, 0, -1], [ 0, 4, 0], [-1, 0, -1], ]; $kernel = \ImagickKernel::fromMatrix($matrix); $kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); $output = "Before adding unity kernel:
"; $output .= renderKernelTable($kernel->getMatrix()); $kernel->addUnityKernel(0.5); $output .= "After adding unity kernel:
"; $output .= renderKernelTable($kernel->getMatrix()); $kernel->scale(1, \Imagick::NORMALIZE_KERNEL_VALUE); $output .= "After renormalizing kernel:
"; $output .= renderKernelTable($kernel->getMatrix()); echo $output; ?>
`ImagickKernel::addUnityKernel`
scale(4, \Imagick::NORMALIZE_KERNEL_VALUE); $kernel->addUnityKernel(0.5); $imagick = new \Imagick(realpath($imagePath)); $imagick->filter($kernel); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); } ?>

```php