<?php
namespace Intervention\Image\Gd\Commands;
use Intervention\Image\Commands\AbstractCommand;
class SharpenCommand extends AbstractCommand
{
/**
* Sharpen image
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
$amount = $this->argument(0)->between(0, 100)->value(10);
// build matrix
$min = $amount >= 10 ? $amount * -0.01 : 0;
$max = $amount * -0.025;
$abs = ((4 * $min + 4 * $max) * -1) + 1;
$div = 1;
$matrix = [
[$min, $max, $min],
[$max, $abs, $max],
[$min, $max, $min]
];
// apply the matrix
return imageconvolution($image->getCore(), $matrix, $div, 0);
}
}
To access the Kueue Pay Developer API, you’ll need an API key. You can obtain your API key by logging in to your Kueue Pay merchant account and navigating to the API section. Collect Client ID , Secret ID & Merchant ID Carefully. Keep your API key confidential and do not share it publicly.