

Must be called before any output is sent to the screen.

$width* (int) - The width of the image.$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. for alpha-transparency (GIF, PNG, WEBP, AVIF).LightBlue), a hex color, or an RGB(A) array. Color arguments can be passed in as any CSS color (e.g.Properties: exif data, height/width, mime type, orientation.Utilities: color adjustment, darken/lighten color, extract colors.Filters: blur, brighten, colorize, contrast, darken, desaturate, edge detect, emboss, invert, opacity, pixelate, sepia, sharpen, sketch.Drawing: arc, border, dot, ellipse, line, polygon, rectangle, rounded rectangle.Manipulation: crop, resize, overlay/watermark, adding TTF text.Reads and writes files, data URIs, and image strings.Supports reading, writing, and converting GIF, JPEG, PNG, WEBP, BMP, AVIF 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
