note 106739 modified in function.imagick-resampleimage by danbrown

From: Date: Fri, 02 Dec 2011 22:22:26 +0000
Subject: note 106739 modified in function.imagick-resampleimage by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-184871@lists.php.net to get a copy of this message
Lets say you want to reduce the resolution of uploaded images for the web. The following will load a image at whatever resolution and resample it down to 72 dpi and save as a different file. The dpi for setImageResolution() and resampleImage() should be whatever dpi your resampling too. <?php $image = new Imagick(); $image->readImage('image.jpg'); $image->setImageResolution(72,72); $image->resampleImage(72,72,imagick::FILTER_UNDEFINED,0); $image->writeImage('image72.jpg'); ?> --was-- Lets say you want to reduce the resolution of uploaded images for the web. The following will load a image at whatever resolution and resample it down to 72 dpi and save as a different file. The dpi for setImageResolution() and resampleImage() should be whatever dpi your resampling too. $image = new Imagick(); $image->readImage('image.jpg'); $image->setImageResolution(72,72); $image->resampleImage(72,72,imagick::FILTER_UNDEFINED,0); $image->writeImage('image72.jpg'); http://php.net/manual/en/function.imagick-resampleimage.php

« previous php.notes (#184871) next »