2017 © Pedro Peláez
 

library image

Eden image component.

image

eden/image

Eden image component.

  • Friday, November 13, 2015
  • by cblanquera
  • Repository
  • 14 Watchers
  • 1 Stars
  • 8,215 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

logo Eden Image

Build Status

====, (*1)

, (*2)

Install

composer install eden/image, (*3)

====, (*4)

, (*5)

Introduction

Instantiate image in this manner., (*6)

$image = eden('image', '/path/to/image.jpg');

Once you are done modifying the image you can save the image to a file or simply echo out the image object like below., (*7)

header('Content-Type: image/jpg');
echo $image;

====, (*8)

, (*9)

API

====, (*10)

, (*11)

blur

Applies the selective blur filter. Blurs the image, (*12)

Usage

eden('image', '/path/to/image.jpg')->blur();

Parameters

Returns Eden\Image\Index, (*13)

====, (*14)

, (*15)

brightness

Applies the brightness filter. Changes the brightness of the image., (*16)

Usage

eden('image', '/path/to/image.jpg')->brightness(*number $level);

Parameters

  • *number $level - The level of brightness

Returns Eden\Image\Index, (*17)

Example

eden('image', '/path/to/image.jpg')->brightness($level);

====, (*18)

, (*19)

colorize

Applies the colorize filter. Like greyscale except you can specify the color., (*20)

Usage

eden('image', '/path/to/image.jpg')->colorize(*number $red, *number $blue, *number $green, number $alpha);

Parameters

  • *number $red - The 255 value of red to use
  • *number $blue - The 255 value of blue to use
  • *number $green - The 255 value of green to use
  • number $alpha - The level of alpha transparency

Returns Eden\Image\Index, (*21)

Example

eden('image', '/path/to/image.jpg')->colorize($red, $blue, $green);

====, (*22)

, (*23)

contrast

Applies the contrast filter. Changes the contrast of the image., (*24)

Usage

eden('image', '/path/to/image.jpg')->contrast(*number $level);

Parameters

  • *number $level - The level of contrast

Returns Eden\Image\Index, (*25)

Example

eden('image', '/path/to/image.jpg')->contrast($level);

====, (*26)

, (*27)

crop

Crops the image, (*28)

Usage

eden('image', '/path/to/image.jpg')->crop(int|null $width, int|null $height);

Parameters

  • int|null $width - The width; If null will use the original width
  • int|null $height - The height; If null will use the original height

Returns Eden\Image\Index, (*29)

Example

eden('image', '/path/to/image.jpg')->crop();

====, (*30)

, (*31)

edgedetect

Applies the edgedetect filter. Uses edge detection to highlight the edges in the image., (*32)

Usage

eden('image', '/path/to/image.jpg')->edgedetect();

Parameters

Returns Eden\Image\Index, (*33)

====, (*34)

, (*35)

emboss

Applies the emboss filter. Embosses the image., (*36)

Usage

eden('image', '/path/to/image.jpg')->emboss();

Parameters

Returns Eden\Image\Index, (*37)

====, (*38)

, (*39)

gaussianBlur

Applies the gaussian blur filter. Blurs the image using the Gaussian method., (*40)

Usage

eden('image', '/path/to/image.jpg')->gaussianBlur();

Parameters

Returns Eden\Image\Index, (*41)

====, (*42)

, (*43)

getDimensions

Returns the size of the image, (*44)

Usage

eden('image', '/path/to/image.jpg')->getDimensions();

Parameters

Returns array, (*45)

====, (*46)

, (*47)

getResource

Returns the resource for custom editing, (*48)

Usage

eden('image', '/path/to/image.jpg')->getResource();

Parameters

Returns [RESOURCE], (*49)

====, (*50)

, (*51)

greyscale

Applies the greyscale filter. Converts the image into grayscale., (*52)

Usage

eden('image', '/path/to/image.jpg')->greyscale();

Parameters

Returns Eden\Image\Index, (*53)

====, (*54)

, (*55)

invert

Inverts the image., (*56)

Usage

eden('image', '/path/to/image.jpg')->invert(bool $vertical);

Parameters

  • bool $vertical - If true invert vertical; if false invert horizontal

Returns Eden\Image\Index, (*57)

Example

eden('image', '/path/to/image.jpg')->invert();

====, (*58)

, (*59)

meanRemoval

Applies the mean removal filter. Uses mean removal to achieve a "sketchy" effect., (*60)

Usage

eden('image', '/path/to/image.jpg')->meanRemoval();

Parameters

Returns Eden\Image\Index, (*61)

====, (*62)

, (*63)

negative

Applies the greyscale filter. Reverses all colors of the image., (*64)

Usage

eden('image', '/path/to/image.jpg')->negative();

Parameters

Returns Eden\Image\Index, (*65)

====, (*66)

, (*67)

resize

Resizes the image. This is a version of scale but keeping it's original aspect ratio, (*68)

Usage

eden('image', '/path/to/image.jpg')->resize(int|null $width, int|null $height);

Parameters

  • int|null $width - the width; if null will use the original width
  • int|null $height - the height; if null will use the original height

Returns Eden\Image\Index, (*69)

Example

eden('image', '/path/to/image.jpg')->resize();

====, (*70)

, (*71)

rotate

Rotates the image., (*72)

Usage

eden('image', '/path/to/image.jpg')->rotate(*int $degree, int $background);

Parameters

  • *int $degree - The degree to rotate by
  • int $background - Background color code

Returns Eden\Image\Index, (*73)

Example

eden('image', '/path/to/image.jpg')->rotate(123);

====, (*74)

, (*75)

scale

Scales the image. If width or height is set to null a width or height will be auto determined based on the aspect ratio, (*76)

Usage

eden('image', '/path/to/image.jpg')->scale(int|null $width, int|null $height);

Parameters

  • int|null $width - The width; if null will use the original width
  • int|null $height - The height; if null will use the original height

Returns Eden\Image\Index, (*77)

Example

eden('image', '/path/to/image.jpg')->scale();

====, (*78)

, (*79)

setTransparency

Sets the background color to be transparent, (*80)

Usage

eden('image', '/path/to/image.jpg')->setTransparency();

Parameters

Returns Eden\Image\Index, (*81)

====, (*82)

, (*83)

smooth

Applies the smooth filter. Makes the image smoother., (*84)

Usage

eden('image', '/path/to/image.jpg')->smooth(*number $level);

Parameters

  • *number $level - The level of smoothness

Returns Eden\Image\Index, (*85)

Example

eden('image', '/path/to/image.jpg')->smooth($level);

====, (*86)

, (*87)

save

Saves the image data to a file, (*88)

Usage

eden('image', '/path/to/image.jpg')->save(*string $path, string|null $type);

Parameters

  • *string $path - The path to save to
  • string|null $type - The render type

Returns Eden\Image\Index, (*89)

Example

eden('image', '/path/to/image.jpg')->save('foo');

====, (*90)

, (*91)

Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing., (*92)

Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. Fire up your local terminal create a new branch from the v4 branch of your fork with a branch name describing what your changes are. Possible branch name types:
    • bugfix
    • feature
    • improvement
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

The Versions

13/11 2015

dev-master

9999999-dev http://eden-php.com

Eden image component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/11 2015

4.x-dev

4.9999999.9999999.9999999-dev http://eden-php.com

Eden image component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/10 2015

4.0.1

4.0.1.0 http://eden-php.com

Eden image component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

07/10 2015

v4

4.0.0.0 http://eden-php.com

Eden image component.

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/09 2013

1.0.3

1.0.3.0 http://eden-php.com

Eden image component

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/09 2013

1.0.2

1.0.2.0 http://eden-php.com

Eden image component

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden