Image
class Image extends AbstractImage
Image implementation using the Imagick PHP extension.
Properties
protected MetadataBag | $metadata | from AbstractImage |
Methods
Generates a thumbnail from a current image Returns it as a new image, doesn't modify the current image.
Updates a given array of save options for backward compatibility with legacy names.
Clones all the resources associated to this instance.
Get the class factory instance to be used.
Constructs a new Image instance.
Destroys allocated imagick resources.
Returns the underlying \Imagick instance.
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.
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.
Returns the image content as a binary string.
Enables or disables interlacing.
Returns the image content as a PNG binary string.
Instantiates and returns a DrawerInterface instance for image drawing.
No description
Returns current image size.
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified.
Fills image with provided filling, by replacing each pixel's color in the current image with corresponding color from FillInterface, and returns modified image.
Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances.
Returns a color given a pixel, depending the Palette context.
Returns the image layers when applicable.
Return the current color palette.
Clone the Imagick resource of this instance.
Details
in AbstractImage at line 36
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, doesn't modify the current image.
in AbstractImage at line 144
protected int[]
getAllThumbnailModes()
Get all the available thumbnail modes.
in AbstractImage at line 159
protected array
updateSaveOptions(array $options)
Updates a given array of save options for backward compatibility with legacy names.
in AbstractImage at line 174
MetadataBag
metadata()
Returns the Image's meta data.
at line 93
__clone()
Clones all the resources associated to this instance.
in AbstractImage at line 194
ClassFactoryInterface
getClassFactory()
Get the class factory instance to be used.
in AbstractImage at line 208
$this
setClassFactory(ClassFactoryInterface $classFactory)
Set the class factory instance to be used.
at line 77
__construct(Imagick $imagick, PaletteInterface $palette, MetadataBag $metadata)
Constructs a new Image instance.
at line 108
__destruct()
Destroys allocated imagick resources.
at line 121
Imagick
getImagick()
Returns the underlying \Imagick instance.
at line 131
ManipulatorInterface
copy()
Copies current source image into a new ImageInterface instance.
at line 145
$this
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self.
at line 177
$this
flipHorizontally()
Flips current image using vertical axis.
at line 193
$this
flipVertically()
Flips current image using horizontal axis.
at line 209
$this
strip()
Remove all profiles and comments.
at line 231
$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 274
$this
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self.
at line 298
$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 323
$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 345
$this
show(string $format, array $options = array())
Outputs the image content.
at line 358
string
get(string $format, array $options = array())
Returns the image content as a binary string.
at line 375
$this
interlace(string $scheme)
Enables or disables interlacing.
at line 427
string
__toString()
Returns the image content as a PNG binary string.
at line 437
DrawerInterface
draw()
Instantiates and returns a DrawerInterface instance for image drawing.
at line 447
EffectsInterface
effects()
at line 457
BoxInterface
getSize()
Returns current image size.
at line 477
$this
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel.
at line 512
ImageInterface
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified.
at line 531
$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 562
ColorInterface[]
histogram()
Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances.
at line 582
ColorInterface
getColorAt(PointInterface $point)
Returns color at specified positions of current image.
at line 608
ColorInterface
pixelToColor(ImagickPixel $pixel)
Returns a color given a pixel, depending the Palette context.
Note : this method is public for PHP 5.3 compatibility
at line 643
LayersInterface
layers()
Returns the image layers when applicable.
at line 657
$this
usePalette(PaletteInterface $palette)
Set a palette for the image. Useful to change colorspace.
at line 696
PaletteInterface
palette()
Return the current color palette.
at line 706
$this
profile(ProfileInterface $profile)
Applies a color profile on the Image.
at line 1062
protected Imagick
cloneImagick()
Clone the Imagick resource of this instance.