|
| __construct ($filename=null, $width=null, $height=null, $color=null) |
|
| __destruct () |
|
| adaptive_resize ($width, $height=null) |
|
| auto_orient () |
|
| best_fit ($max_width, $max_height) |
|
| blur ($type= 'selective', $passes=1) |
|
| brightness ($level) |
|
| contrast ($level) |
|
| colorize ($color, $opacity) |
|
| create ($width, $height=null, $color=null) |
|
| crop ($x1, $y1, $x2, $y2) |
|
| desaturate () |
|
| edges () |
|
| emboss () |
|
| fill ($color= '#000000') |
|
| fit_to_height ($height) |
|
| fit_to_width ($width) |
|
| flip ($direction) |
|
| get_height () |
|
| get_orientation () |
|
| get_original_info () |
|
| get_width () |
|
| invert () |
|
| load ($filename) |
|
| load_base64 ($base64string) |
|
| mean_remove () |
|
| opacity ($opacity) |
|
| output ($format=null, $quality=null) |
|
| output_base64 ($format=null, $quality=null) |
|
| overlay ($overlay, $position= 'center', $opacity=1, $x_offset=0, $y_offset=0) |
|
| pixelate ($block_size=10) |
|
| resize ($width, $height) |
|
| rotate ($angle, $bg_color= '#000000') |
|
| save ($filename=null, $quality=null) |
|
| sepia () |
|
| sketch () |
|
| smooth ($level) |
|
| text ($text, $font_file, $font_size=12, $color= '#000000', $position= 'center', $x_offset=0, $y_offset=0) |
|
| thumbnail ($width, $height=null) |
|
|
| $quality = 80 |
|
| $filename |
|
| $original_info |
|
| $width |
|
| $height |
|
| $imagestring |
|
|
| file_ext ($filename) |
|
| get_meta_data () |
|
| imagecopymerge_alpha ($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct) |
|
| keep_within ($value, $min, $max) |
|
| normalize_color ($color) |
|
Definition at line 21 of file simple.image.simp.php.
__construct |
( |
|
$filename = null , |
|
|
|
$width = null , |
|
|
|
$height = null , |
|
|
|
$color = null |
|
) |
| |
Create instance and load an image, or create an image from scratch
- Parameters
-
null | string | $filename | Path to image file (may be omitted to create image from scratch) |
int | $width | Image width (is used for creating image from scratch) |
int | null | $height | If omitted - assumed equal to $width (is used for creating image from scratch) |
null | string | $color | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127
(is used for creating image from scratch) |
- Returns
- SimpleImage
- Exceptions
-
Definition at line 45 of file simple.image.simp.php.
adaptive_resize |
( |
|
$width, |
|
|
|
$height = null |
|
) |
| |
Adaptive resize
This function has been deprecated and will be removed in an upcoming release. Please update your code to use the thumbnail()
method instead. The arguments for both methods are exactly the same.
- Parameters
-
int | $width | |
int | null | $height | If omitted - assumed equal to $width |
- Returns
- SimpleImage
Definition at line 77 of file simple.image.simp.php.
Rotates and/or flips an image automatically so the orientation will be correct (based on exif 'Orientation')
- Returns
- SimpleImage
Definition at line 89 of file simple.image.simp.php.
best_fit |
( |
|
$max_width, |
|
|
|
$max_height |
|
) |
| |
Best fit (proportionally resize to fit in specified width/height)
Shrink the image proportionally to fit inside a $width x $height box
- Parameters
-
int | $max_width | |
int | $max_height | |
- Returns
- SimpleImage
Definition at line 142 of file simple.image.simp.php.
blur |
( |
|
$type = 'selective' , |
|
|
|
$passes = 1 |
|
) |
| |
colorize |
( |
|
$color, |
|
|
|
$opacity |
|
) |
| |
Colorize
- Parameters
-
string | $color | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127 |
float | int | $opacity | 0-1 |
- Returns
- SimpleImage
Definition at line 232 of file simple.image.simp.php.
create |
( |
|
$width, |
|
|
|
$height = null , |
|
|
|
$color = null |
|
) |
| |
Create an image from scratch
- Parameters
-
int | $width | Image width |
int | null | $height | If omitted - assumed equal to $width |
null | string | $color | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127 |
- Returns
- SimpleImage
Definition at line 250 of file simple.image.simp.php.
crop |
( |
|
$x1, |
|
|
|
$y1, |
|
|
|
$x2, |
|
|
|
$y2 |
|
) |
| |
Returns the file extension of the specified file
- Parameters
-
- Returns
- string
Definition at line 1050 of file simple.image.simp.php.
fill |
( |
|
$color = '#000000' | ) |
|
Fill image with color
- Parameters
-
string | $color | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127 |
- Returns
- SimpleImage
Definition at line 353 of file simple.image.simp.php.
Get meta data of image or base64 string
- Parameters
-
string | null | $imagestring | If omitted treat as a normal image |
- Returns
- SimpleImage
- Exceptions
-
Definition at line 1069 of file simple.image.simp.php.
Get the current orientation
- Returns
- string portrait|landscape|square
Definition at line 448 of file simple.image.simp.php.
Get info about the original image
- Returns
- array
array(
width => 320,
height => 200,
orientation => ['portrait', 'landscape', 'square'],
exif => array(...),
mime => ['image/jpeg', 'image/gif', 'image/png'],
format => ['jpeg', 'gif', 'png']
)
Definition at line 475 of file simple.image.simp.php.
imagecopymerge_alpha |
( |
|
$dst_im, |
|
|
|
$src_im, |
|
|
|
$dst_x, |
|
|
|
$dst_y, |
|
|
|
$src_x, |
|
|
|
$src_y, |
|
|
|
$src_w, |
|
|
|
$src_h, |
|
|
|
$pct |
|
) |
| |
|
protected |
Same as PHP's imagecopymerge() function, except preserves alpha-transparency in 24-bit PNGs
- Parameters
-
Definition at line 1128 of file simple.image.simp.php.
keep_within |
( |
|
$value, |
|
|
|
$min, |
|
|
|
$max |
|
) |
| |
|
protected |
Ensures $value is always within $min and $max range.
If lower, $min is returned. If higher, $max is returned.
- Parameters
-
int | float | $value | |
int | float | $min | |
int | float | $max | |
- Returns
- int|float
Definition at line 1191 of file simple.image.simp.php.
load_base64 |
( |
|
$base64string | ) |
|
normalize_color |
( |
|
$color | ) |
|
|
protected |
Converts a hex color value to its RGB equivalent
- Parameters
-
string | $color | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127 |
- Returns
- array|bool
Definition at line 1214 of file simple.image.simp.php.
output |
( |
|
$format = null , |
|
|
|
$quality = null |
|
) |
| |
Outputs image without saving
- Parameters
-
null | string | $format | If omitted or null - format of original file will be used, may be gif|jpg|png |
int | null | $quality | Output image quality in percents 0-100 |
- Exceptions
-
Definition at line 587 of file simple.image.simp.php.
output_base64 |
( |
|
$format = null , |
|
|
|
$quality = null |
|
) |
| |
Outputs image as data base64 to use as img src
- Parameters
-
null | string | $format | If omitted or null - format of original file will be used, may be gif|jpg|png |
int | null | $quality | Output image quality in percents 0-100 |
- Returns
- string
- Exceptions
-
Definition at line 644 of file simple.image.simp.php.
overlay |
( |
|
$overlay, |
|
|
|
$position = 'center' , |
|
|
|
$opacity = 1 , |
|
|
|
$x_offset = 0 , |
|
|
|
$y_offset = 0 |
|
) |
| |
Overlay
Overlay an image on top of another, works with 24-bit PNG alpha-transparency
- Parameters
-
string | $overlay | An image filename or a SimpleImage object |
string | $position | center|top|left|bottom|right|top left|top right|bottom left|bottom right |
float | int | $opacity | Overlay opacity 0-1 |
int | $x_offset | Horizontal offset in pixels |
int | $y_offset | Vertical offset in pixels |
- Returns
- SimpleImage
Definition at line 707 of file simple.image.simp.php.
pixelate |
( |
|
$block_size = 10 | ) |
|
resize |
( |
|
$width, |
|
|
|
$height |
|
) |
| |
rotate |
( |
|
$angle, |
|
|
|
$bg_color = '#000000' |
|
) |
| |
Rotate an image
- Parameters
-
int | $angle | 0-360 |
string | $bg_color | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127 |
- Returns
- SimpleImage
Definition at line 829 of file simple.image.simp.php.
save |
( |
|
$filename = null , |
|
|
|
$quality = null |
|
) |
| |
Save an image
The resulting format will be determined by the file extension.
- Parameters
-
null | string | $filename | If omitted - original file will be overwritten |
null | int | $quality | Output image quality in percents 0-100 |
- Returns
- SimpleImage
- Exceptions
-
Definition at line 859 of file simple.image.simp.php.
text |
( |
|
$text, |
|
|
|
$font_file, |
|
|
|
$font_size = 12 , |
|
|
|
$color = '#000000' , |
|
|
|
$position = 'center' , |
|
|
|
$x_offset = 0 , |
|
|
|
$y_offset = 0 |
|
) |
| |
Add text to an image
- Parameters
-
string | $text | |
string | $font_file | |
float | int | $font_size | |
string | $color | |
string | $position | |
int | $x_offset | |
int | $y_offset | |
- Returns
- SimpleImage
- Exceptions
-
Definition at line 942 of file simple.image.simp.php.
thumbnail |
( |
|
$width, |
|
|
|
$height = null |
|
) |
| |
Thumbnail
This function attempts to get the image to as close to the provided dimensions as possible, and then crops the remaining overflow (from the center) to get the image to be the size specified. Useful for generating thumbnails.
- Parameters
-
int | $width | |
int | null | $height | If omitted - assumed equal to $width |
- Returns
- SimpleImage
Definition at line 1019 of file simple.image.simp.php.
The documentation for this class was generated from the following file: