CakeFest 2025 Madrid: The Official CakePHP Conference

Imagick::getImageRenderingIntent

(PECL imagick 2, PECL imagick 3)

Imagick::getImageRenderingIntentGets the image rendering intent

Description

public Imagick::getImageRenderingIntent(): int

Gets the image rendering intent.

Parameters

This function has no parameters.

Return Values

Returns the image rendering intent.

Errors/Exceptions

Throws ImagickException on error.

add a note

User Contributed Notes 1 note

up
0
holdoffhunger at gmail dot com
12 years ago
The Rendering Intent variable exists in ImageMagick to provide support for ICC Color Profiles. There are five results that one can expect to get from the getRenderingIntent function, which are the predefined constants for Rendering Intent within ImageMagick. These values look like "imagick::RENDERINGINTENT_UNDEFINED", with "_VALUE" values of: undefined, saturation, perceptual, absolute, and relative. Printed out, Undefined is 0, Saturation is 1, Perceptual is 2, Absolute is 3, and Relative is 4.

The official ImageMagick documentation provides good light on what these values indicate. ( http://www.cambridgeincolour.com/tutorials/color-space-conversion.htm .

Some sample code :

<?php

/ Author: holdoffhunger@gmail.com

/ Imagick Type
/ ---------------------------------------------

$imagick_type = new Imagick();

/ Open File
/ ---------------------------------------------

$file_to_grab = "image_workshop_directory/test.jpg";

$file_handle_for_viewing_image_file = fopen($file_to_grab, 'a+');

/ Grab File
/ ---------------------------------------------

$imagick_type->readImageFile($file_handle_for_viewing_image_file);

/ Get Rendering Intent Values
/ ---------------------------------------------

$imagick_rendering_intent = $imagick_type->getImageRenderingIntent();

switch(
$imagick_rendering_intent)
{
case
'0':
$image_rendering_intent_evaluated = "Undefined";
break;

case
'1':
$image_rendering_intent_evaluated = "Saturation";
break;

case
'2':
$image_rendering_intent_evaluated = "Perceptual";
break;

case
'3':
$image_rendering_intent_evaluated = "Absolute";
break;

case
'4':
$image_rendering_intent_evaluated = "Relative";
break;
}

/ Print Rendering Intent Values
/ ---------------------------------------------

print("# $imagick_rendering_intent - $image_rendering_intent_evaluated");

?>
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant