class Image implements ImageInterface
Image implementation using the Gmagick PHP extension
Methods
__construct(Gmagick $gmagick)
Constructs Image with Gmagick and Imagine instances |
||
__destruct()
Destroys allocated gmagick resources |
||
Gmagick |
getGmagick()
Returns gmagick instance |
|
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 |
flipHorizontally()
Flips current image using horizontal axis |
|
ManipulatorInterface |
flipVertically()
Flips current image using vertical axis |
|
ManipulatorInterface |
strip()
Remove all profiles and comments |
|
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)
Resizes current image and returns self |
|
ManipulatorInterface |
rotate(integer $angle, Color $background = null)
Rotates an image at the given angle. |
|
ManipulatorInterface |
save(string $path, 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 |
thumbnail(BoxInterface $size, string $mode = ImageInterface::THUMBNAIL_INSET)
Generates a thumbnail from a current image Returns it as a new image, doesn't modify the current image |
|
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 |
|
ImageInterface |
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified |
|
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 |
|
array |
histogram()
Returns array of image colors as Imagine\Image\Color instances |
|
Color |
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 |
Details
at line 45
public
__construct(Gmagick $gmagick)
Constructs Image with Gmagick and Imagine instances
at line 54
public
__destruct()
Destroys allocated gmagick resources
at line 67
public Gmagick
getGmagick()
Returns gmagick instance
at line 75
public ManipulatorInterface
copy()
Copies current source image into a new ImageInterface instance
at line 83
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 112
public ManipulatorInterface
flipHorizontally()
Flips current image using horizontal axis
at line 128
public ManipulatorInterface
flipVertically()
Flips current image using vertical axis
at line 144
public ManipulatorInterface
strip()
Remove all profiles and comments
at line 160
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 195
public ManipulatorInterface
resize(BoxInterface $size)
Resizes current image and returns self
at line 216
public ManipulatorInterface
rotate(integer $angle, Color $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 266
public ManipulatorInterface
save(string $path, 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 284
public ManipulatorInterface
show(string $format, array $options = array())
Outputs the image content
at line 295
public string
get(string $format, array $options = array())
Returns the image content as a binary string
at line 342
public string
__toString()
Returns the image content as a PNG binary string
at line 350
public ManipulatorInterface
thumbnail(BoxInterface $size, string $mode = ImageInterface::THUMBNAIL_INSET)
Generates a thumbnail from a current image Returns it as a new image, doesn't modify the current image
at line 384
public DrawerInterface
draw()
Instantiates and returns a DrawerInterface instance for image drawing
at line 392
public EffectsInterface
effects()
at line 400
public BoxInterface
getSize()
Returns current image size
at line 417
public ManipulatorInterface
applyMask(ImageInterface $mask)
Applies a given mask to current image's alpha channel
at line 456
public ImageInterface
mask()
Transforms creates a grayscale mask from current image, returns a new image, while keeping the existing image unmodified
at line 474
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 506
public array
histogram()
Returns array of image colors as Imagine\Image\Color instances
at line 531
public Color
getColorAt(PointInterface $point)
Returns color at specified positions of current image
at line 563
public LayersInterface
layers()
Returns the image layers when applicable.
at line 571
public ImageInterface
interlace(string $scheme)
Enables or disables interlacing