![]() Get info about the original image (before any changes were made) // // Returns: // // array( // width => 320, // height => 200, // orientation =>, // exif => array(.), // mime =>, // format => // ) $info = $img-> get_original_info() The image you're working with or output the image directly to the browser: The following methods are not chainable, because they return information about Valid positions are center, top, right, bottom, left, top left, top.Add 32-point white text top-centered (plus 20px) on the image* $img-> text( 'Your Text', 'font.ttf', 32, '#FFFFFF', 'top', 0, 20) 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-> adaptive_resize( 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') ![]() Add 'SimpleImage' => 'Shekarsiri\Simpleimage\SimpleImage' to your 'aliases' array in the app\config\app.php file.Add 'Shekarsiri\Simpleimage\SimpleimageServiceProvider' to your 'providers' array in the app\config\app.php file. ![]() Add "shekarsiri/simpleimage": "dev-master" to your /laravel/composer.json.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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |