Coder Social home page Coder Social logo

2braincells2go / imagemanipulation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elgervb/imagemanipulation

0.0 3.0 0.0 1.89 MB

PHP Library for image manipulation, filters, watermark, thumbnailing, overlays, etc

PHP 99.04% JavaScript 0.96%

imagemanipulation's Introduction

IMAGEMANIPULATION

Build Status Latest Stable Version
Fork me on GitHub: https://github.com/elgervb/imagemanipulation

Library to manipulate images using PHP's GD library. Most of the functionality is available through the ImageBuilder facade. This way chaining of image filters and thumbnailing is possible, like:

ImageBuilder::create( new \SplFileInfo('image.jpg') )
  ->contrast( 20 ) // increase contrast
  ->colorize( '#DB3636' ) // apply a bit of red the the image
  ->flip( ImageFilterFlip::FLIP_VERTICALLY ) // flip image vertically
  ->save( new \SplFileInfo( 'image.new.png' ) ) // save the jpg image as png with filters applied
  ->render( 80 ); // render to browser with quality 80

Installation

With composer.json:

	"require" : {
		"elgervb/imagemanipulation": "^1.0"
	}

Requirements

PHP version >= 5.3 with GD library

FUNCTIONALITY

Filters

Lots of image filters. All of them listed below:

  • brightness
  • colorize
  • comic
  • contrast
  • convolution 3x3 filters
  • darken
  • dodge
  • duotone
  • edge detect
  • emboss
  • find edges
  • flip (horizonal, vertical, both)
  • gamma correction
  • gaussian blur
  • grayscale
  • hue rotate
  • mean remove
  • motion blur
  • negative
  • noise
  • old cardboard
  • opacity
  • pixelate
  • random blocks with custom size and color
  • replace color
  • reverse
  • rounded corners
  • scatter
  • selective blur
  • semi grayscale
  • sepia
  • sepia fast
  • sharpen
  • smooth
  • sobel edge detect
  • sobel edge enhance (based on convolution matrix)
  • true color
  • vignette

Overlay

Use an image as overlay on another image. Can be configured with overlay opacity, start and end position and fill options.

Reflection

Use the current image to make a reflection below the original image

Image repeater

Repeat images on a canvas, until it fits. This way we can create Warhol like images.

Rotate

Rotate images in degrees. When rotating an image not equal to 90, 180, 270 or 360 degrees, then optionally you can specify a background color for those oncovered edges.

Thumbnails

Create thumbnails on the fly. There are several strategies to use:

  • Centered strategy: create a thumb from the center of an image. Ideal for creating square thumbs from not so square images
  • Max strategy: resize the image to a max width or height keeping proportions. For example: when resizing an image (300x750) on max 500 pixels, the resulting image will be 200x500 pixels
  • Percentage strategy: reduce the size of an image with a certain percentage.

Watermarking

Add a watermark to your image. Possible positions are: top, bottom, left, right, center, top right, top left, bottom right, bottom left.

imagemanipulation's People

Contributors

elgervb avatar

Watchers

James Cloos avatar Woody avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.