Personal License FREE

1 site, unlimited servers No source distribution Non-commercial use only No modifications Read full license | More Info

Support Provided $4.99

1 site, unlimited servers No source distribution Non-commercial use only Distribute modifications 1 year support Read full license | More Info

Developer License $24.99

Unlimited projects Source and binary distribution Commercial use allowed Distribute modifications 1 year support Read full license | More Info

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

Starting from FREE

View Pricing 14 days money-back guarantee
(4 ratings)

PHP Imagizer - Image Manipulator

PHP Imagizer is a smart and easy-to-use image resizer, image watermarking and cropping component

Share and win up to $15k in prizes each month!Learn more

Share

Description

One of the chalenging that comes with developing and maintaining content management systems (CMS), blogs or forums is to allow to users of the site an easy way to manipulate high quality images throughout the site without any graphical tools.

PHP Imagizer is object-oriented component which developed for those purposes and other use cases. It is well commented and easy-to-use component. Requires GD extension usually compiled in PHP.

With this component you can make transparent text and graphical watermarking, resize and preserve aspect ratio and crop images.

Features

  • Very simple and intuitive to use
  • Transparent text watermarking with option to change rotation, opacity, font size, font face, font color and shadow affect
  • Image watermarking
  • Resizing image to fit size, by weight and by height with preserving aspect ratio
  • Cropping
  • JPEG, GIF and PNG support
Back to top

Usage Examples

Resize to fit size with preserving aspect ratio

include {PATH_TO_LIBRARY} . 'PhpImagizer.php';
// Source file name
$srcFileName = 'sourceImage.gif';
try {
    // Get instance
    $imagizer = new PhpImagizer($srcFileName);
    // Resize to fit 200px
    $imagizer->fitSize(200);
    // Save image
    $imagizer->saveImg('DestFileName.gif');
} catch (PhpImagizerException $e) {
   // Do something (Log, send email?)
}

Crop image

include {PATH_TO_LIBRARY} . 'PhpImagizer.php';
// Source file name
$srcFileName = 'sourceImage.gif';
try {
    // Get instance
    $imagizer = new PhpImagizer($srcFileName);
    // Crop image
    $imagizer->crop(200, 200);
     // Save image
    $imagizer->saveImg('DestFileName.gif');
} catch (PhpImagizerException $e) {
    // Do something (Log, send email?)
}

Text watermark

include {PATH_TO_LIBRARY} . 'PhpImagizer.php';
// Source file name
$srcFileName = 'sourceImage.gif';
// The path to the TrueType font you wish to use
$font = 'arial.ttf';
 try {
// Get instance
    $imagizer = new PhpImagizer($srcFileName);
    // Set shadow, transparency, color and size
    $params = array(
        'color' => '#FFFFFF',
        'transparency' => 70,
        'size' => 40,
        'font' => $font,
        'shadow' => 1 ,
    );
    // Make watermark at bottom center and save it to DestFileName.gif
    $imagizer->watermarkText('www.example.com', PhpImagizer::POSITION_BOTTOM_CENTER, $params);
    $imagizer->saveImg('DestFileName.gif');
} catch (PhpImagizerException $e) {
    // Do something (Log, send email?)
}
Read all 4 comments »

Questions & Comments

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
  • Federico Villa said:

    10 months ago
    Great script Ruslan, this is what I was looking for weeks. Just wondering if the transparent background issue has been fixed.
  • Paulius Ĺ arauskas said:

    2 years ago
    Script lacks support for resizing images with transparent background.
    • Ruslan Glick Author said:

      2 years ago
      Hello Paulius,
      Thank you for your feedback.
      Can you please give more information. What method you are using? Can you send me the image you are trying to resize?
    • Paulius Ĺ arauskas said:

      2 years ago
      Hi, it's nice to see a swift reply!
      Take any transparent image and test it. I now tested the script with this site's logo http://www.binpress.com/images/header/logo.png
      The output is an image with a gray background.
      It's not a problem for me though, I edited the script and added the missing functions to keep the transparency.
      Thanks for the script!
You must be logged-in to vote. Log-in to your account or register now.
View all 3 reviews »

User Reviews

  • 0 of 1 people found this review helpful
    good
    - inarli, 2 years ago
    Flag review
    Was this helpful? Yes No
  • 1 of 1 people found this review helpful
    Quite useful, it would be nice to use Zend coding standard, actual do check for GD library existence, not only have a TODO for it. Also functions such as byHeight() don't really reflect what they do.
    - Cristian Radu, 2 years ago
    Flag review
    Was this helpful? Yes No
  • 1 of 1 people found this review helpful
    Documentation is lacking.
    - Christ O' Conner, 6 months ago
    Flag review
    Was this helpful? Yes No

Starting from FREE

View Pricing 14 days money-back guarantee