WideImage 1.0 branch (discontinued)

WideImage Wiki : SimpleExamples

MainPage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Support This Project SourceForge.net Logo
Important notice: this branch was discontinued long ago. A new version is available.

Please visit http://wideimage.sourceforge.net for the new version of library and documentation.
This web site will remain accessible to serve as documentation for the old versions of the library. For help on migration, please refer to the migration guide.

Simple examples


Simple load, resize and save:
$image = wiImage::load('/path/to/an/image.png');
$resized = $image->resize(400, 300);
$resized->saveToFile('/path/to/resized.png');


Chaining operations:
$img = wiImage::load('image.png');
$img->resize(200, 500)->saveToFile('new.png');


A long chain:
$img = wiImage::load('image.png');
$img->resize(200, 500)->crop(10, 10, 80, 80)->asGrayscale()->saveToFile('new.png');


Load, crop, flip and output to browser in one line (no http headers included):
echo wiImage::load('image.png')->crop(30, 30, '50%', '50%')->flip()->asString('png');


Merge example:
$img = wiImage::load('pic.jpeg');
$watermark = wiImage::load('watermark.jpg');
$new_img = $img->merge($watermark, 40, 80);


For more, see ImageOperations.


CategoryDoc

There are no comments on this page. [Add comment]

WideImage - an Object-Oriented PHP Image Library for Image manipulation
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.1150 seconds