• File: BrightnessCommand.php
  • Full Path: /home/masbinta/public_html/core/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BrightnessCommand.php
  • File size: 492 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace Intervention\Image\Gd\Commands;

use Intervention\Image\Commands\AbstractCommand;

class BrightnessCommand extends AbstractCommand
{
    /**
     * Changes image brightness
     *
     * @param  \Intervention\Image\Image $image
     * @return boolean
     */
    public function execute($image)
    {
        $level = $this->argument(0)->between(-100, 100)->required()->value();

        return imagefilter($image->getCore(), IMG_FILTER_BRIGHTNESS, ($level * 2.55));
    }
}