ImageInterface
interface ImageInterface implements ManipulatorInterface
The image interface.
Constants
RESOLUTION_PIXELSPERINCH |
Resolution units: pixels per inch. |
RESOLUTION_PIXELSPERCENTIMETER |
Resolution units: pixels per centimeter. |
INTERLACE_NONE |
Image interlacing: none. |
INTERLACE_LINE |
Image interlacing: scanline. |
INTERLACE_PLANE |
Image interlacing: plane. |
INTERLACE_PARTITION |
Image interlacing: like plane interlacing except the different planes are saved to individual files. |
FILTER_UNDEFINED |
Image filter: none/undefined. |
FILTER_POINT |
Resampling filter: point (interpolated). |
FILTER_BOX |
Resampling filter: box. |
FILTER_TRIANGLE |
Resampling filter: triangle. |
FILTER_HERMITE |
Resampling filter: hermite. |
FILTER_HANNING |
Resampling filter: hanning. |
FILTER_HAMMING |
Resampling filter: hamming. |
FILTER_BLACKMAN |
Resampling filter: blackman. |
FILTER_GAUSSIAN |
Resampling filter: gaussian. |
FILTER_QUADRATIC |
Resampling filter: quadratic. |
FILTER_CUBIC |
Resampling filter: cubic. |
FILTER_CATROM |
Resampling filter: catrom. |
FILTER_MITCHELL |
Resampling filter: mitchell. |
FILTER_LANCZOS |
Resampling filter: lanczos. |
FILTER_BESSEL |
Resampling filter: bessel. |
FILTER_SINC |
Resampling filter: sinc. |
Methods
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.
Resizes current image and returns self.
Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails.
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, doesn't modify the current image.
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 the image content as a binary string.
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.
Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances.
Returns the image layers when applicable.
Enables or disables interlacing.
Return the current color palette.
Returns the Image's meta data.
Details
in ManipulatorInterface at line 50
ManipulatorInterface
copy()
Copies current source image into a new ImageInterface instance.
in ManipulatorInterface at line 64
$this
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self.
in ManipulatorInterface at line 76
$this
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self.
in ManipulatorInterface at line 90
$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.
in ManipulatorInterface at line 108
$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
in ManipulatorInterface at line 123
$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.
in ManipulatorInterface at line 135
$this
show(string $format, array $options = array())
Outputs the image content.
in ManipulatorInterface at line 144
$this
flipHorizontally()
Flips current image using vertical axis.
in ManipulatorInterface at line 153
$this
flipVertically()
Flips current image using horizontal axis.
in ManipulatorInterface at line 162
$this
strip()
Remove all profiles and comments.
in ManipulatorInterface at line 176
ManipulatorInterface
thumbnail(BoxInterface $size, int|string $settings = self::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 ManipulatorInterface at line 185
$this
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel.
in ManipulatorInterface at line 196
$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 185
string
get(string $format, array $options = array())
Returns the image content as a binary string.
at line 194
string
__toString()
Returns the image content as a PNG binary string.
at line 201
DrawerInterface
draw()
Instantiates and returns a DrawerInterface instance for image drawing.
at line 206
EffectsInterface
effects()
at line 213
BoxInterface
getSize()
Returns current image size.
at line 221
ImageInterface
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified.
at line 228
ColorInterface[]
histogram()
Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances.
at line 239
ColorInterface
getColorAt(PointInterface $point)
Returns color at specified positions of current image.
at line 249
LayersInterface
layers()
Returns the image layers when applicable.
at line 260
$this
interlace(string $scheme)
Enables or disables interlacing.
at line 267
PaletteInterface
palette()
Return the current color palette.
at line 278
$this
usePalette(PaletteInterface $palette)
Set a palette for the image. Useful to change colorspace.
at line 289
$this
profile(ProfileInterface $profile)
Applies a color profile on the Image.
at line 296
MetadataBag
metadata()
Returns the Image's meta data.