<?php
namespace Intervention\Image\Gd\Commands;
use Intervention\Image\Commands\AbstractCommand;
class OpacityCommand extends AbstractCommand
{
/**
* Defines opacity of an image
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
$transparency = $this->argument(0)->between(0, 100)->required()->value();
// get size of image
$size = $image->getSize();
// build temp alpha mask
$mask_color = sprintf('rgba(0, 0, 0, %.1F)', $transparency / 100);
$mask = $image->getDriver()->newImage($size->width, $size->height, $mask_color);
// mask image
$image->mask($mask->getCore(), true);
return true;
}
}
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.