DJ Mike's Tutorials: PHP

Imagick Functions

^

Imagick::resizeImage

Description:
bool Imagick::resizeImage ( int $columns , int $rows , int $filter , float $blur [, bool $fit ] )

Scales an image to the desired dimensions with a filter.
Parameters:
columns
Width of the image.
rows
Height of the image
filter
Types of filters:
Filter constants.
imagick::FILTER_UNDEFINED
imagick::FILTER_POINT
imagick::FILTER_BOX
imagick::FILTER_TRIANGLE
imagick::FILTER_HERMITE
imagick::FILTER_HANNING
imagick::FILTER_HAMMING
imagick::FILTER_BLACKMAN
imagick::FILTER_GAUSSIAN
imagick::FILTER_QUADRATIC
imagick::FILTER_CUBIC
imagick::FILTER_CATROM
imagick::FILTER_MITCHELL
imagick::FILTER_LANCZOS
imagick::FILTER_BESSEL
imagick::FILTER_SINC
blur
The blur factor where > 1 is blurry, < 1 is sharp.
fit
Optional fit parameter, defaults to false. If FALSE, pass zero as either columns of rows for proportional scaling. Use TRUE for nonproportional resizing.
Return Values
Returns TRUE on success.

Examples


<?php
header
('Content-type: image/jpeg'); 
$image = new Imagick("opossum.jpg"); 
$image->resizeimage(20050imagick::FILTER_HAMMING0FALSE ); 
echo 
$image
?> 


<?php
header
('Content-type: image/jpeg'); 
$image = new Imagick("opossum.jpg"); 
$image->resizeimage(0300imagick::FILTER_HAMMING0FALSE ); 
echo 
$image
?> 


^


Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>