mvccore/ext-tool-image
Composer 安装命令:
composer require mvccore/ext-tool-image
包简介
MvcCore - Extension - Tool - Image - object oriented image processing tool supporting many popular web images operations.
关键字:
README 文档
README
Installation
composer require mvccore/ext-tool-image
Features
Extension helps to process many popular web images operations:
Image Image::AddOverlay($overlayImgFullPath, $x, $y, $alpha, $composite); // Adding overlay image is not implemented for Gd adapter Image Image::ApplyMask($maskImgFullPath); Image Image::Contain($width, $height); Image Image::Cover($width, $height, $orientation); Image Image::CreateEmptyImageResource($width, $height, $hexBgColor = 'transparent'); Image Image::Crop($x, $y, $width, $height); Image Image::CropPercent($xPercentage, $yPercentage, $widthPercentage, $heightPercentage); Image Image::Frame($width, $height); int Image::GetHeight(); int Image::GetWidth(); Image Image::Grayscale(); array Image::HexColor2RgbArrayColor($hexColor); bool Image::IsVectorGraphic(); Image Image::Load($imgFullPath); Image Image::Resize($width, $height); Image Image::ResizeByHeight($height); Image Image::ResizeByPixelsCount($count); Image Image::ResizeByWidth($width); Image Image::Rotate($angle); Image Image::RoundCorners($x, $y); Image Image::Sepia($threshold = 80); Image Image::SetBackgroundColor($hexColor); Image Image::SetBackgroundImage($bgImgFullPath); Image Image::Save($imgFullPath, $format, $quality); Image Image::UnsharpMask($amount, $radius, $threshold);
Usage
<?php include_once('vendor/autoload.php'); use \MvcCore\Ext\Tools; // resize `source.jpg` to `thumb.jpg`: $image = Tools\Image::CreateInstance() ->Load(__DIR__ . "/source.jpg") ->ResizeByHeight(150) ->UnsharpMask(300, 0.7, 50) ->Save( __DIR__ . "/thumb.jpg", Tools\Images\IFormat::JPG, 100 ); // display original and resized image: echo '<html><body>', '<img src="source.jpg" />', '<br />', '<img src="thumb.jpg" />', '</body></html>';
Imagick Windows binaries for dummies:
统计信息
- 总下载量: 229
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-11-16