Transformation
class Transformation implements FilterInterface, ManipulatorInterface
A transformation filter.
Methods
Applies a given FilterInterface onto given ImageInterface and returns modified ImageInterface.
Returns a list of filters sorted by their priority. Filters with same priority will be returned in the order they were added.
Copies current source image into a new ImageInterface instance.
Crops a specified box out of the source image (modifies the source image) Returns cropped self.
Flips current image using vertical axis.
Flips current image using horizontal axis.
Remove all profiles and comments.
Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails.
Fills image with provided filling, by replacing each pixel's color in the current image with corresponding color from FillInterface, and returns modified image.
Resizes current image and returns self.
Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp, xbm, webp and bmp are supported.
Outputs the image content.
Generates a thumbnail from a current image Returns it as a new image without modifying the current image unless the THUMBNAIL_FLAG_NOCLONE flag is specified.
Registers a given FilterInterface in an internal array of filters for later application to an instance of ImageInterface.
Details
at line 63
__construct(ImagineInterface $imagine = null)
Class constructor.
at line 78
ImageInterface
applyFilter(ImageInterface $image, FilterInterface $filter)
Applies a given FilterInterface onto given ImageInterface and returns modified ImageInterface.
at line 95
array
getFilters()
Returns a list of filters sorted by their priority. Filters with same priority will be returned in the order they were added.
at line 114
ImageInterface
apply(ImageInterface $image)
Applies scheduled transformation to an ImageInterface instance.
at line 128
ManipulatorInterface
copy()
Copies current source image into a new ImageInterface instance.
at line 138
$this
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self.
at line 148
$this
flipHorizontally()
Flips current image using vertical axis.
at line 158
$this
flipVertically()
Flips current image using horizontal axis.
at line 168
$this
strip()
Remove all profiles and comments.
at line 178
$this
paste(ImageInterface $image, PointInterface $start, int $alpha = 100)
Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails.
Returns source image
at line 188
$this
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel.
at line 198
$this
fill(FillInterface $fill)
Fills image with provided filling, by replacing each pixel's color in the current image with corresponding color from FillInterface, and returns modified image.
at line 208
$this
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self.
at line 218
$this
rotate(int $angle, ColorInterface $background = null)
Rotates an image at the given angle.
Optional $background can be used to specify the fill color of the empty area of rotated image.
at line 228
$this
save(string $path = null, array $options = array())
Saves the image at a specified path, the target file extension is used to determine file format, only jpg, jpeg, gif, png, wbmp, xbm, webp and bmp are supported.
Please remark that bmp is supported by the GD driver only since PHP 7.2.
at line 238
$this
show(string $format, array $options = array())
Outputs the image content.
at line 248
ManipulatorInterface
thumbnail(BoxInterface $size, int|string $settings = ImageInterface::THUMBNAIL_INSET, string $filter = ImageInterface::FILTER_UNDEFINED)
Generates a thumbnail from a current image Returns it as a new image without modifying the current image unless the THUMBNAIL_FLAG_NOCLONE flag is specified.
at line 261
$this
add(FilterInterface $filter, int $priority = 0)
Registers a given FilterInterface in an internal array of filters for later application to an instance of ImageInterface.