Recommend this page to a friend! |
Download .zip |
Info | View files (5) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2012-01-28 (4 years ago) | Not yet rated by the users | Total: 492 | All time: 5,583 This week: 1,109 |
Version | License | PHP version | Categories | |||
php-image-class 1.0 | GNU General Publi... | 5.2 | PHP 5, Graphics |
Description | Author | |||||||||||||
This class can apply several types of image effects. |
|
Image class for basic image redesign. Author: Daniel Kovacs Email: kovacsdanielhun@gmail.com Webiste: kovacsdaniel.blogspot.com Version: 1.0 beta Release date: 2012.01.18 Thanks to: http://www.tuxradar.com/practicalphp/11/2/16 (special algorythms) http://php.about.com/od/gdlibrary/ss/grayscale_gd.htm (black and white algorythm) It's in beta version, so there can be bugs, if you find any, or you have some new ideas for functions I should implement, please write to kovacsdanielhun@gmail.com. Known Issues: - This class can only work with gifs and jpegs, and pngs - scatter bugs a little Installation: 1. Copy file to your website's folder 2. Include it 3. Set up settings $image = new Image; $settings = array(); $jobs = array(); /* Set up settings */ $settings['original_name'] = 'anyfolder/source.jpeg'; $settings['new_name'] = 'folder/dest.jpeg'; /* */ $settings['original_type'] = 'jpeg'; $settings['new_type'] = 'jpeg'; 4. Set up jobs /* You need to fill the 'jobs' $jobs with jobs like: */ $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "contrast"; $jobs[0]['contrast'] = 50; $jobs[1]['job'] = "duotone"; $jobs[1]['rplus'] = 10; $jobs[1]['gplus'] = 40; $jobs[1]['bplus'] = 80; $jobs[2]['job'] = 'resize'; $jobs[2]['width'] = 10; $jobs[2]['height'] = 0; $jobs[2]['percent'] = 0; $jobs[2]['scale'] = 0; /* You can have plenty of jobs, just have to increase $jobs[$i] ($i) */ /* You can see other usable filters and jobs under */ /* To start processing type these: */ $image->settings = $settings; $image->jobs = $jobs; $image->run(); 5. get image or render image ( when you render an image, after render it destroys the image in memory ) /* To get image you can use this: */ $image->image; /* or/and */ $image->render_image(); 6. get errors $image->errors(); /* array */ Available Jobs: $jobs[0]['job'] = 'crop' $jobs[0]['left'] = 120; (pixels from left) $jobs[0]['top'] = 120; (pixels from top) $jobs[0]['right'] = 120; (pixels from right) $jobs[0]['bottom'] = 120; (pixels from bottom) $jobs[0]['job'] = "rotate"; $jobs[0]['angle'] = 0; $jobs[0]['background'] = 0; $jobs[0]['transparent'] = 0; $jobs[0]['job'] = "watermark"; $jobs[0][0] = 0; $jobs[0][1] = 0; $jobs[0][2] = "watermark.png"; $jobs[0]['job'] = "resize"; $jobs[0]['width'] = 0; $jobs[0]['height'] = 0; $jobs[0]['percent'] = 0; Available Special Effects (Algorythms) $jobs[0]['job'] = "blackwhite"; $jobs[0]['job'] = "interlace"; $jobs[0]['job'] = "screen"; $jobs[0]['job'] = "duotone"; $jobs[0]['job'] = "noise"; $jobs[0]['job'] = "scatter"; $jobs[0]['job'] = "color_reduction"; Available Filters: $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "colorize"; $jobs[0]['r'] = 255; $jobs[0]['g'] = 0; $jobs[0]['b'] = 123; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "brightness"; $jobs[0]['brightness'] = 80; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "contrast"; $jobs[0]['contrast'] = 50; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "edgedetect"; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "emboss"; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "gaussian_blur"; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "selective_blur"; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "smooth"; $jobs[0]['smooth'] = -6; /-8 - 8/ $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "negate"; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "mean_removal"; $jobs[0]['job'] = "filter"; $jobs[0]['filter'] = "grayscale"; Error codes: x0000: error: settings or jobs are not set x0001: error: image not found x0002: image is a null ->no image left /* too many crops */ x0003: error in arg list |
Files |
File | Role | Description |
---|---|---|
image.php | Class | base class |
readme.txt | Doc. | readme |
test.JPEG | Icon | test image |
test.php | Example | test file |
example.png | Output | Example |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
Sourceforge sf |