$mime
$mime : string
Mime type
$mime : string
Mime type
$dirname : string
Name of directory path
$basename : string
Basename of current file
$extension : string
File extension of current file
$filename : string
File name of current file
$encoded : string
Last image encoding result
$driver : \Intervention\Image\AbstractDriver
Instance of current image driver
$core : mixed
Image resource/object of current image processor
$backups : array
Array of Image resource backups of current image processor
cache(\Closure $callback, int $lifetime = null, bool $returnObj = false) : \Intervention\Image\Image
Method to create a new cached image instance from a Closure callback. Pass a lifetime in minutes for the callback and decide whether you want to get an Intervention Image instance as return value or just receive the image stream.
\Closure | $callback | |
int | $lifetime = null | |
bool | $returnObj = false |
canvas(int $width, int $height, mixed $bgcolor = null) : \Intervention\Image\Image
Factory method to create a new empty image instance with given width and height. You can define a background-color optionally. By default the canvas background is transparent.
int | $width | |
int | $height | |
mixed | $bgcolor = null |
circle(int $diameter, int $x, int $y, \Closure $callback = null) : \Intervention\Image\Image
Draw a circle at given x, y, coordinates with given diameter. You can define the appearance of the circle by an optional closure callback.
int | $diameter | |
int | $x | |
int | $y | |
\Closure | $callback = null |
colorize(int $red, int $green, int $blue) : \Intervention\Image\Image
Change the RGB color values of the current image on the given channels red, green and blue. The input values are normalized so you have to include parameters from 100 for maximum color value. 0 for no change and -100 to take out all the certain color on the image.
int | $red | |
int | $green | |
int | $blue |
crop(int $width, int $height, int $x = null, int $y = null) : \Intervention\Image\Image
Cut out a rectangular part of the current image with given width and height. Define optional x,y coordinates to move the top-left corner of the cutout to a certain position.
int | $width | |
int | $height | |
int | $x = null | |
int | $y = null |
ellipse(int $width, int $height, int $x, int $y, \Closure $callback = null) : \Intervention\Image\Image
Draw a colored ellipse at given x, y, coordinates. You can define width and height and set the appearance of the circle by an optional closure callback.
int | $width | |
int | $height | |
int | $x | |
int | $y | |
\Closure | $callback = null |
fill(mixed $filling, int $x = null, int $y = null) : \Intervention\Image\Image
Fill current image with given color or another image used as tile for filling. Pass optional x, y coordinates to start at a certain point.
mixed | $filling | |
int | $x = null | |
int | $y = null |
fit(int $width, int $height = null, \Closure $callback = null, string $position = 'center') : \Intervention\Image\Image
Combine cropping and resizing to format image in a smart way. The method will find the best fitting aspect ratio of your given width and height on the current image automatically, cut it out and resize it to the given dimension. You may pass an optional Closure callback as third parameter, to prevent possible upsizing and a custom position of the cutout as fourth parameter.
int | $width | |
int | $height = null | |
\Closure | $callback = null | |
string | $position = 'center' |
heighten(int $height, \Closure $callback = null) : \Intervention\Image\Image
Resizes the current image to new height, constraining aspect ratio. Pass an optional Closure callback as third parameter, to apply additional constraints like preventing possible upsizing.
int | $height | |
\Closure | $callback = null |
insert(mixed $source, string $position = 'top-left', int $x = 0, int $y = 0) : \Intervention\Image\Image
Paste a given image source over the current image with an optional position and a offset coordinate. This method can be used to apply another image as watermark because the transparency values are maintained.
mixed | $source | |
string | $position = 'top-left' | |
int | $x = 0 | |
int | $y = 0 |
interlace(bool $interlace = true) : \Intervention\Image\Image
Determine whether an image should be encoded in interlaced or standard mode by toggling interlace mode with a boolean parameter. If an JPEG image is set interlaced the image will be processed as a progressive JPEG.
bool | $interlace = true |
limitColors(int $count, mixed $matte = null) : \Intervention\Image\Image
Method converts the existing colors of the current image into a color table with a given maximum count of colors. The function preserves as much alpha channel information as possible and blends transarent pixels against a optional matte color.
int | $count | |
mixed | $matte = null |
line(int $x1, int $y1, int $x2, int $y2, \Closure $callback = null) : \Intervention\Image\Image
Draw a line from x,y point 1 to x,y point 2 on current image. Define color and/or width of line in an optional Closure callback.
int | $x1 | |
int | $y1 | |
int | $x2 | |
int | $y2 | |
\Closure | $callback = null |
mask(mixed $source, bool $mask_with_alpha) : \Intervention\Image\Image
Apply a given image source as alpha mask to the current image to change current opacity. Mask will be resized to the current image size. By default a greyscale version of the mask is converted to alpha values, but you can set mask_with_alpha to apply the actual alpha channel. Any transparency values of the current image will be maintained.
mixed | $source | |
bool | $mask_with_alpha |
rectangle(int $x1, int $y1, int $x2, int $y2, \Closure $callback = null) : \Intervention\Image\Image
Draw a colored rectangle on current image with top-left corner on x,y point 1 and bottom-right corner at x,y point 2. Define the overall appearance of the shape by passing a Closure callback as an optional parameter.
int | $x1 | |
int | $y1 | |
int | $x2 | |
int | $y2 | |
\Closure | $callback = null |
resize(int $width = null, int $height = null, \Closure $callback = null) : \Intervention\Image\Image
Resizes current image based on given width and/or height. To contraint the resize command, pass an optional Closure callback as third parameter.
int | $width = null | |
int | $height = null | |
\Closure | $callback = null |
resizeCanvas(int $width, int $height, string $anchor = 'center', bool $relative = false, mixed $bgcolor = null) : \Intervention\Image\Image
Resize the boundaries of the current image to given width and height. An anchor can be defined to determine from what point of the image the resizing is going to happen. Set the mode to relative to add or subtract the given width or height to the actual image dimensions. You can also pass a background color for the emerging area of the image.
int | $width | |
int | $height | |
string | $anchor = 'center' | |
bool | $relative = false | |
mixed | $bgcolor = null |
rotate(float $angle, mixed $bgcolor = null) : \Intervention\Image\Image
Rotate the current image counter-clockwise by a given angle. Optionally define a background color for the uncovered zone after the rotation.
float | $angle | |
mixed | $bgcolor = null |
text(string $text, int $x = 0, int $y = 0, \Closure $callback = null) : \Intervention\Image\Image
Write a text string to the current image at an optional x,y basepoint position. You can define more details like font-size, font-file and alignment via a callback as the fourth parameter.
string | $text | |
int | $x = 0 | |
int | $y = 0 | |
\Closure | $callback = null |
widen(int $width, \Closure $callback = null) : \Intervention\Image\Image
Resizes the current image to new width, constraining aspect ratio. Pass an optional Closure callback as third parameter, to apply additional constraints like preventing possible upsizing.
int | $width | |
\Closure | $callback = null |