PHP.mk документација

Imagick::solarizeImage

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

imagick.solarizeimage.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека imagick.solarizeimage.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
Imagick::solarizeImage

Референца за `imagick.solarizeimage.php` со подобрена типографија и навигација.

imagick.solarizeimage.php

Imagick::solarizeImage

(PECL imagick 2, PECL imagick 3)

Imagick::solarizeImageApplies a solarizing effect to the image

= NULL

public Imagick::solarizeImage(int $threshold): bool

Применува ефект на соларизација на сликата

Параметри

threshold

Вратени вредности

Патеката до PHP скриптата што треба да се провери. true на успешен исход.

Примери

Пример #1 Imagick::solarizeImage()

<?php
function solarizeImage($imagePath, $solarizeThreshold) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->solarizeImage($solarizeThreshold * \Imagick::getQuantum());
header("Content-Type: image/jpg");
echo
$imagick->getImageBlob();
}

?>

Белешки од корисници 1 белешка

Keisial на gmail точка com
пред 13 години
This is something neat that you can do to an image as part of making it artistic, probably in conjunction with other ImageMagick effects, like PosterizeImage and OilPaintImage.  SolarizeImage shifts the whole color spectrum toward red for an image -- white gets pushed directly into red, blues get pushed into greens, etc..  It is mostly a psychedelic effect.  You have the option of choosing one parameter for "Threshold", which is really simply how much of this effect you want to have in an image.  The minimum value is 0, and using a negative number defaults it to 0.  The maximum value is the Quantum Threshold.  You can get this value by the ImageMagick function getQuantumRange.  On my install of PHP, that value is set to 65535 (2^16).  Going higher than the Quantum Range defaults to the Quantum Range.  An image with this function performed on it at Threshold 0 has the maximum effect performed, and at Threshold maximum the image has no changes made to it at all.

And now a simple demonstration of the code :

<?php

            // Author: [email protected]

        // Grab Image File Data
        // ---------------------------------------------
        
    $file_to_grab_with_location = "graphics_engine/image_workshop_directory/test.bmp";
    
    $imagick_type = new Imagick();
    
        // Open File
        // ---------------------------------------------
            
    $file_handle_for_viewing_image_file = fopen($file_to_grab_with_location, 'a+');

    $imagick_type->readImageFile($file_handle_for_viewing_image_file);
    
        // Perform Function
        // ---------------------------------------------
        
    $imagick_type->solarizeImage(30000);
    
        // Filename
        // ---------------------------------------------
        
    $file_to_save_with_location = "graphics_engine/image_workshop_directory/test_new.bmp";
    
        // Save File
        // ---------------------------------------------
            
    $file_handle_for_saving_image_file = fopen($file_to_save_with_location, 'a+');

    $imagick_type->writeImageFile($file_handle_for_saving_image_file);

?>
Навигација

Прелистувај сродни теми и функции.

На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.