Please not that I had extremely high CPU usage using this function on Ubuntu linux 15.10. Switching to the resizeImage function fixed the problem.
PHP.mk документација
Imagick::resampleImage
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Патека
imagick.resampleimage.php
Локална патека за оваа страница.
Извор
php.net/manual/en
Оригиналниот HTML се реупотребува и локално се стилизира.
Режим
Прокси + превод во позадина
Кодовите, табелите и белешките остануваат читливи во истиот тек.
Референца
imagick.resampleimage.php
Imagick::resampleImage
Референца за `imagick.resampleimage.php` со подобрена типографија и навигација.
Imagick::resampleImage
(PECL imagick 2, PECL imagick 3)
Imagick::resampleImage — Пресликај ја сликата на посакуваната резолуција
= NULL
public Imagick::resampleImage(
float
float
int
float
): bool
float
$x_resolution,float
$y_resolution,int
$filter,float
$blur): bool
Пресликај ја сликата на посакуваната резолуција.
Параметри
x_resolution-
y_resolution-
filter-
blur-
Вратени вредности
Патеката до PHP скриптата што треба да се провери. true на успешен исход.
Примери
Пример #1 Imagick::resampleImage()
<?php
function resampleImage($imagePath) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->resampleImage(200, 200, \Imagick::FILTER_LANCZOS, 1);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>Белешки од корисници 3 белешки
simon ¶
пред 10 години
bleighty at dvidshub dot net ¶
12 години пред
Please note that blur of 1 should not affect the image if I'm understanding correctly from this page:
http://www.php.net/manual/en/imagick.resizeimage.php
anagai на yahoo dot com ¶
пред 14 години
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');
?>