class Image extends AbstractImage
Image implementation using the GD library
Methods
ManipulatorInterface |
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 |
MetadataInterface |
metadata()
Returns the Image's meta data |
from AbstractImage |
__clone()
Assures the metadata instance will be cloned, too |
from AbstractImage | |
__construct(resource $resource, PaletteInterface $palette, MetadataBag $metadata)
Constructs a new Image instance |
||
__destruct()
Makes sure the current image resource is destroyed |
||
resource |
getGdResource()
Returns Gd resource |
|
ManipulatorInterface |
copy()
Copies current source image into a new ImageInterface instance |
|
ManipulatorInterface |
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self |
|
ManipulatorInterface |
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 |
|
ManipulatorInterface |
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self |
|
ManipulatorInterface |
rotate(integer $angle, ColorInterface $background = null)
Rotates an image at the given angle. |
|
ManipulatorInterface |
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 |
|
ManipulatorInterface |
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 |
|
string |
__toString()
Returns the image content as a PNG binary string |
|
ManipulatorInterface |
flipHorizontally()
Flips current image using horizontal axis |
|
ManipulatorInterface |
flipVertically()
Flips current image using vertical axis |
|
ManipulatorInterface |
strip()
Remove all profiles and comments |
|
DrawerInterface |
draw()
Instantiates and returns a DrawerInterface instance for image drawing |
|
EffectsInterface |
effects()
|
|
BoxInterface |
getSize()
Returns current image size |
|
ManipulatorInterface |
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel |
|
ManipulatorInterface |
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 |
|
ImageInterface |
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified |
|
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 |
|
LayersInterface |
layers()
Returns the image layers when applicable. |
|
ImageInterface |
interlace(string $scheme)
Enables or disables interlacing |
|
PaletteInterface |
palette()
Return the current color palette |
|
ImageInterface |
profile(ProfileInterface $profile)
Applies a color profile on the Image |
|
ImageInterface |
usePalette(PaletteInterface $palette)
Set a palette for the image. |
Details
in AbstractImage at line 27
public ManipulatorInterface
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 103
public MetadataInterface
metadata()
Returns the Image's meta data
in AbstractImage at line 111
public
__clone()
Assures the metadata instance will be cloned, too
at line 58
public
__construct(resource $resource, PaletteInterface $palette, MetadataBag $metadata)
Constructs a new Image instance
at line 68
public
__destruct()
Makes sure the current image resource is destroyed
at line 80
public resource
getGdResource()
Returns Gd resource
at line 88
final public ManipulatorInterface
copy()
Copies current source image into a new ImageInterface instance
at line 103
final public ManipulatorInterface
crop(PointInterface $start, BoxInterface $size)
Crops a specified box out of the source image (modifies the source image) Returns cropped self
at line 128
final public ManipulatorInterface
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 155
final public ManipulatorInterface
resize(BoxInterface $size, string $filter = ImageInterface::FILTER_UNDEFINED)
Resizes current image and returns self
at line 186
final public ManipulatorInterface
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 204
final public ManipulatorInterface
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 229
public ManipulatorInterface
show(string $format, array $options = array())
Outputs the image content
at line 241
public string
get(string $format, array $options = array())
Returns the image content as a binary string
at line 252
public string
__toString()
Returns the image content as a PNG binary string
at line 260
final public ManipulatorInterface
flipHorizontally()
Flips current image using horizontal axis
at line 283
final public ManipulatorInterface
flipVertically()
Flips current image using vertical axis
at line 306
final public ManipulatorInterface
strip()
Remove all profiles and comments
at line 315
public DrawerInterface
draw()
Instantiates and returns a DrawerInterface instance for image drawing
at line 323
public EffectsInterface
effects()
at line 331
public BoxInterface
getSize()
Returns current image size
at line 339
public ManipulatorInterface
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel
at line 371
public ManipulatorInterface
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 389
public ImageInterface
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified
at line 403
public array
histogram()
Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances
at line 420
public ColorInterface
getColorAt(PointInterface $point)
Returns color at specified positions of current image
at line 435
public LayersInterface
layers()
Returns the image layers when applicable.
at line 447
public ImageInterface
interlace(string $scheme)
Enables or disables interlacing
at line 468
public PaletteInterface
palette()
Return the current color palette
at line 476
public ImageInterface
profile(ProfileInterface $profile)
Applies a color profile on the Image
at line 484
public ImageInterface
usePalette(PaletteInterface $palette)
Set a palette for the image.
Useful to change colorspace.