Свойство | Тип | Описание | |
---|---|---|---|
$quality | Default output image quality |
Свойство | Тип | Описание | |
---|---|---|---|
$filename | |||
$height | |||
$image | |||
$imagestring | |||
$original_info | |||
$width |
Метод | Описание | |
---|---|---|
__construct ( null | string $filename = null, integer $width = null, integer | null $height = null, null | string $color = null ) : SimpleImage | Create instance and load an image, or create an image from scratch | |
__destruct ( ) | Destroy image resource | |
adaptive_resize ( integer $width, integer | null $height = null ) : SimpleImage | Adaptive resize | |
auto_orient ( ) : SimpleImage | Rotates and/or flips an image automatically so the orientation will be correct (based on exif 'Orientation') | |
best_fit ( integer $max_width, integer $max_height ) : SimpleImage | Best fit (proportionally resize to fit in specified width/height) | |
blur ( string $type = 'selective', integer $passes = 1 ) : SimpleImage | Blur | |
brightness ( integer $level ) : SimpleImage | Brightness | |
colorize ( string $color, float | integer $opacity ) : SimpleImage | Colorize | |
contrast ( integer $level ) : SimpleImage | Contrast | |
create ( integer $width, integer | null $height = null, null | string $color = null ) : SimpleImage | Create an image from scratch | |
crop ( integer $x1, integer $y1, integer $x2, integer $y2 ) : SimpleImage | Crop an image | |
desaturate ( ) : SimpleImage | Desaturate (grayscale) | |
edges ( ) : SimpleImage | Edge Detect | |
emboss ( ) : SimpleImage | Emboss | |
fill ( string $color = '#000000' ) : SimpleImage | Fill image with color | |
fit_to_height ( integer $height ) : SimpleImage | Fit to height (proportionally resize to specified height) | |
fit_to_width ( integer $width ) : SimpleImage | Fit to width (proportionally resize to specified width) | |
flip ( string $direction ) : SimpleImage | Flip an image horizontally or vertically | |
get_height ( ) : integer | Get the current height | |
get_orientation ( ) : string | Get the current orientation | |
get_original_info ( ) : array | Get info about the original image | |
get_width ( ) : integer | Get the current width | |
invert ( ) : SimpleImage | Invert | |
load ( string $filename ) : SimpleImage | Load an image | |
load_base64 ( $base64string ) : SimpleImage | Load a base64 string as image | |
mean_remove ( ) : SimpleImage | Mean Remove | |
opacity ( float | integer $opacity ) | Changes the opacity level of the image | |
output ( null | string $format = null, integer | null $quality = null ) | Outputs image without saving | |
output_base64 ( null | string $format = null, integer | null $quality = null ) : string | Outputs image as data base64 to use as img src | |
overlay ( string $overlay, string $position = 'center', float | integer $opacity = 1, integer $x_offset, integer $y_offset ) : SimpleImage | Overlay | |
pixelate ( integer $block_size = 10 ) : SimpleImage | Pixelate | |
resize ( integer $width, integer $height ) : SimpleImage | Resize an image to the specified dimensions | |
rotate ( integer $angle, string $bg_color = '#000000' ) : SimpleImage | Rotate an image | |
save ( null | string $filename = null, null | integer $quality = null ) : SimpleImage | Save an image | |
sepia ( ) : SimpleImage | Sepia | |
sketch ( ) : SimpleImage | Sketch | |
smooth ( integer $level ) : SimpleImage | Smooth | |
text ( string $text, string $font_file, float | integer $font_size = 12, string $color = '#000000', string $position = 'center', integer $x_offset, integer $y_offset ) : SimpleImage | Add text to an image | |
thumbnail ( integer $width, integer | null $height = null ) : SimpleImage | Thumbnail |
Метод | Описание | |
---|---|---|
file_ext ( string $filename ) : string | Returns the file extension of the specified file | |
get_meta_data ( ) : SimpleImage | Get meta data of image or base64 string | |
imagecopymerge_alpha ( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct ) | Same as PHP's imagecopymerge() function, except preserves alpha-transparency in 24-bit PNGs | |
keep_within ( integer | float $value, integer | float $min, integer | float $max ) : integer | float | Ensures $value is always within $min and $max range. | |
normalize_color ( string $color ) : array | boolean | Converts a hex color value to its RGB equivalent |
public __construct ( null | string $filename = null, integer $width = null, integer | null $height = null, null | string $color = null ) : SimpleImage | ||
$filename | null | string | Path to image file (may be omitted to create image from scratch) |
$width | integer | Image width (is used for creating image from scratch) |
$height | integer | null | If omitted - assumed equal to $width (is used for creating image from scratch) |
$color | null | string | 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) |
Результат | SimpleImage |
public auto_orient ( ) : SimpleImage | ||
Результат | SimpleImage |
public brightness ( integer $level ) : SimpleImage | ||
$level | integer | Darkest = -255, lightest = 255 |
Результат | SimpleImage |
public create ( integer $width, integer | null $height = null, null | string $color = null ) : SimpleImage | ||
$width | integer | Image width |
$height | integer | null | If omitted - assumed equal to $width |
$color | null | string | Hex color string, array(red, green, blue) or array(red, green, blue, alpha). Where red, green, blue - integers 0-255, alpha - integer 0-127 |
Результат | SimpleImage |
public desaturate ( ) : SimpleImage | ||
Результат | SimpleImage |
public fit_to_height ( integer $height ) : SimpleImage | ||
$height | integer | |
Результат | SimpleImage |
public fit_to_width ( integer $width ) : SimpleImage | ||
$width | integer | |
Результат | SimpleImage |
public get_height ( ) : integer | ||
Результат | integer |
protected get_meta_data ( ) : SimpleImage | ||
Результат | SimpleImage |
public get_orientation ( ) : string | ||
Результат | string | portrait|landscape|square |
public get_original_info ( ) : array | ||
Результат | array | array( width => 320, height => 200, orientation => ['portrait', 'landscape', 'square'], exif => array(...), mime => ['image/jpeg', 'image/gif', 'image/png'], format => ['jpeg', 'gif', 'png'] ) |
protected imagecopymerge_alpha ( $dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct ) | ||
$dst_im | ||
$src_im | ||
$dst_x | ||
$dst_y | ||
$src_x | ||
$src_y | ||
$src_w | ||
$src_h | ||
$pct |
public load_base64 ( $base64string ) : SimpleImage | ||
Результат | SimpleImage |
public mean_remove ( ) : SimpleImage | ||
Результат | SimpleImage |
public overlay ( string $overlay, string $position = 'center', float | integer $opacity = 1, integer $x_offset, integer $y_offset ) : SimpleImage | ||
$overlay | string | An image filename or a SimpleImage object |
$position | string | center|top|left|bottom|right|top left|top right|bottom left|bottom right |
$opacity | float | integer | Overlay opacity 0-1 |
$x_offset | integer | Horizontal offset in pixels |
$y_offset | integer | Vertical offset in pixels |
Результат | SimpleImage |
public text ( string $text, string $font_file, float | integer $font_size = 12, string $color = '#000000', string $position = 'center', integer $x_offset, integer $y_offset ) : SimpleImage | ||
$text | string | |
$font_file | string | |
$font_size | float | integer | |
$color | string | |
$position | string | |
$x_offset | integer | |
$y_offset | integer | |
Результат | SimpleImage |