![simpleimage for web simpleimage for web](https://graphicdesignjunction.com/wp-content/uploads/2015/01/23+HTML5+Web+Design.jpg)
$xOffset and $yOffset have no effect in center anchor. $calculateOffsetFromEdge (bool) - Calculate Offset referring to the edges of the image.$yOffset (int) - Vertical offset in pixels (default 0).$xOffset (int) - Horizontal offset in pixels (default 0).$opacity (float) - The opacity level of the overlay 0-1 (default 1).$anchor (string) - The anchor point: 'center', 'top', 'bottom', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right' (default 'center').This can be a filename, a data URI, or a SimpleImage object. $overlay* (string|SimpleImage) - The image to overlay.Place an image on top of the current image. overlay($overlay, $anchor, $opacity, $xOffset, $yOffset) $dither (bool) - Whether or not to use a dithering effect (default true).$max* (int) - The maximum number of colors to use.Reduces the image to a maximum number of colors. $direction* (string) - The direction to flip: x|y|both.flip($direction)įlip the image horizontally or vertically. $width* (int) - The width to resize the image to.This method was deprecated in version 3.2.2 and will be removed in version 4.0. Proportionally resize the image to a specific width. $height* (int) - The height to resize the image to.Please use resize(null, $height) instead. Proportionally resize the image to a specific height. $maxHeight* (int) - The maximum height the image can be.$maxWidth* (int) - The maximum width the image can be.Proportionally resize the image to fit inside a specific width and height. It is safe to call this method on images that don't have exif data (no changes will be made). Rotates an image so the orientation will be correct based on its exif data. Gets the image's current resolution in DPI. Returns a string: 'landscape', 'portrait', or 'square' getResolution() Returns an array of exif data or null if no data is available. Must be called before any output is sent to the screen. $filename* (string) - The filename (without path) to send to the client (e.g.toDownload($filename, $mimeType, $quality)įorces the image to be downloaded to the clients machine. This argument has no effect on PNG images, since the format is lossless. $quality (int) - Image quality as a percentage (default 100).$mimeType (string) - The image format to output as a mime type (defaults to the original mime type).$string = file_get_contents('image.jpg') $string* (string) - The raw image data as a string.$color (string|array) - Optional fill color for the new image (default 'transparent').$height* (int) - The height of the image.$width* (int) - The width of the image.
![simpleimage for web simpleimage for web](https://www.webdesignerdepot.com/cdn-origin/uploads/2013/06/featured48.jpg)
$file* (string) - The image file to load.You can pipe transparency to normalizeColor when you pass a CSS color or hex string: white|0.25.Static methods can be called with $image::methodName() or \claviska\SimpleImage::methodName().You can pass a file or data URI to the constructor to avoid calling fromFile or fromDataUri.Methods that return a SimpleImage object are chainable.An asterisk denotes a required argument.If you enjoy using SimpleImage, especially in commercial applications, please consider sponsoring me to support its development. SimpleImage is developed and maintained by Cory LaViska. reading, writing, and converting GIF, JPEG, PNG, WEBP, BMP formats.Handle errors echo $err-> getMessage() > toScreen() // output to the screen // And much more! ? > toFile( 'new-image.png', 'image/png') // convert to PNG and save a copy to new-image.png > overlay( 'watermark.png', 'bottom right') // add a watermark image > border( 'black', 10) // add a 10 pixel black border > colorize( 'DarkBlue') // tint dark blue > autoOrient() // adjust orientation based on exif data