class Image extends AbstractImage
Image implementation using the Imagick PHP extension
Methods
ImageInterface |
thumbnail(BoxInterface $size, string $mode = 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 |
from AbstractImage |
MetadataBag |
metadata()
Returns the Image's meta data |
from AbstractImage |
__clone()
Assures the metadata instance will be cloned, too |
from AbstractImage | |
__construct(Imagick $imagick, PaletteInterface $palette, MetadataBag $metadata)
Constructs a new Image instance |
||
__destruct()
Destroys allocated imagick resources |
||
Imagick |
getImagick()
Returns the underlying \Imagick instance |
|
ImageInterface |
copy()
Copies current source image into a new ImageInterface instance |
|
ImageInterface |
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self |
|
ImageInterface |
flipHorizontally()
Flips current image using horizontal axis |
|
ImageInterface |
flipVertically()
Flips current image using vertical axis |
|
ImageInterface |
strip()
Remove all profiles and comments |
|
ImageInterface |
paste(ImageInterface $image, PointInterface $start)
Pastes an image into a parent image Throws exceptions if image exceeds parent image borders or if paste operation fails |
|
ImageInterface |
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self |
|
ImageInterface |
rotate(integer $angle, ColorInterface $background = null)
Rotates an image at the given angle. |
|
ImageInterface |
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 and xbm are supported |
|
ImageInterface |
show(string $format, array $options = array())
Outputs the image content |
|
string |
get(string $format, array $options = array())
Returns the image content as a binary string |
|
ImageInterface |
interlace(string $scheme)
Enables or disables interlacing |
|
string |
__toString()
Returns the image content as a PNG binary string |
|
DrawerInterface |
draw()
Instantiates and returns a DrawerInterface instance for image drawing |
|
EffectsInterface |
effects()
|
|
BoxInterface |
getSize()
Returns current image size |
|
ImageInterface |
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel |
|
ImageInterface |
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified |
|
ImageInterface |
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 |
|
array |
histogram()
Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances |
|
ColorInterface |
getColorAt(PointInterface $point)
Returns color at specified positions of current image |
|
ColorInterface |
pixelToColor(ImagickPixel $pixel)
Returns a color given a pixel, depending the Palette context |
|
LayersInterface |
layers()
Returns the image layers when applicable. |
|
ImageInterface |
usePalette(PaletteInterface $palette)
Set a palette for the image. |
|
PaletteInterface |
palette()
Return the current color palette |
|
ImageInterface |
profile(ProfileInterface $profile)
Applies a color profile on the Image |
Details
in AbstractImage at line 29
public ImageInterface
thumbnail(BoxInterface $size, string $mode = 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 105
public MetadataBag
metadata()
Returns the Image's meta data
in AbstractImage at line 113
public
__clone()
Assures the metadata instance will be cloned, too
at line 67
public
__construct(Imagick $imagick, PaletteInterface $palette, MetadataBag $metadata)
Constructs a new Image instance
at line 82
public
__destruct()
Destroys allocated imagick resources
at line 95
public Imagick
getImagick()
Returns the underlying \Imagick instance
at line 105
public ImageInterface
copy()
Copies current source image into a new ImageInterface instance
at line 125
public ImageInterface
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self
at line 147
public ImageInterface
flipHorizontally()
Flips current image using horizontal axis
at line 163
public ImageInterface
flipVertically()
Flips current image using vertical axis
at line 179
public ImageInterface
strip()
Remove all profiles and comments
at line 201
public ImageInterface
paste(ImageInterface $image, PointInterface $start)
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 225
public ImageInterface
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self
at line 241
public ImageInterface
rotate(integer $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 264
public ImageInterface
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 and xbm are supported
at line 286
public ImageInterface
show(string $format, array $options = array())
Outputs the image content
at line 297
public string
get(string $format, array $options = array())
Returns the image content as a binary string
at line 312
public ImageInterface
interlace(string $scheme)
Enables or disables interlacing
at line 362
public string
__toString()
Returns the image content as a PNG binary string
at line 370
public DrawerInterface
draw()
Instantiates and returns a DrawerInterface instance for image drawing
at line 378
public EffectsInterface
effects()
at line 386
public BoxInterface
getSize()
Returns current image size
at line 406
public ImageInterface
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel
at line 439
public ImageInterface
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified
at line 458
public ImageInterface
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 487
public array
histogram()
Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances
at line 505
public ColorInterface
getColorAt(PointInterface $point)
Returns color at specified positions of current image
at line 531
public 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 564
public LayersInterface
layers()
Returns the image layers when applicable.
at line 572
public ImageInterface
usePalette(PaletteInterface $palette)
Set a palette for the image.
Useful to change colorspace.
at line 609
public PaletteInterface
palette()
Return the current color palette
at line 617
public ImageInterface
profile(ProfileInterface $profile)
Applies a color profile on the Image