

`$height`* (int) - The height to resize the image to. Please use `resize(null, $height)` instead._ _This method was deprecated in version 3.2.2 and will be removed in version 4.0. 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. Load with Composer or manually (just one file) Support for alpha-transparency (GIF, PNG, WEBP) `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 formats. >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 >autoOrient() // adjust orientation based on exif data _If this project has you loving PHP image manipulation again, please consider () to support its development._ Add 32-point white text top-centered (plus 20px) on the image* $img-> text( 'Your Text', 'font.A PHP class that makes working with images as simple as possible.ĭeveloped and maintained by (). Overlay watermark.png at 50% opacity at the bottom-right of the image with a 10 pixel horizontal and vertical margin $img-> overlay( 'watermark.png', 'bottom right'. Sepia effect (simulated) $img-> sepia() Pixelate using 8px blocks $img-> pixelate( 8)

Smooth filter (-10 to 10) $img-> smooth( 5) Gaussian blur (two passes) $img-> blur( 'gaussian', 2) Selective blur (one pass) $img-> blur() Mean removal filter $img-> mean_remove() Colorize red at 50% opacity $img-> colorize( '#FF0000'. Desaturate (grayscale) $img-> desaturate() Fill image with white color $img-> fill( '#fff') Shrink the image proportionally to fit inside a 500x500 box $img-> best_fit( 500, 500) Shrink the image to the specified height while maintaining proportion (height) $img-> fit_to_height( 200) Shrink the image to the specified width while maintaining proportion (width) $img-> fit_to_width( 320) Trim the image and resize to exactly 100x75 $img-> thumbnail( 100, 75) Adjust the orientation if needed (physically rotates/flips the image based on its EXIF 'Orientation' property) $img-> auto_orient() Rotate the image 90 degrees clockwise $img-> rotate( 90) Flip the image horizontally (use 'y' to flip vertically) $img-> flip( 'x') You can load an image when you instantiate a new SimpleImage object: This class requires PHP 5.3 and PHP GD library. Convert between GIF, JPEG, and PNG formats.Overlay one image onto another (watermarking).Desaturate, colorize, pixelate, blur, etc.Resize images (free resize, resize to width, resize to height, resize to fit).It 90 degrees clockwise, shrink it to fit within a 320x200 box, apply a sepiaĮffect, convert it to a GIF, and save it to result.gif.

The two lines inside the try block load image.jpg, flip it horizontally, rotate
