Imagick::getColorspace


wizard apg

GETS the color space of an image.



<?php

int 
public Imagick::getColorspace();

?>

 


This function has no parameters.





Gets the global colorspace value.

Available if Imagick has been compiled against ImageMagick version 6.5.7 or newer.

Returns an integer which can be compared against COLORSPACE constants.

See the COLORSPACE values for each exercise on this page - compare with the values in the table.

If possible create your own exercises to obtain other values in the table.




RANDOMIZED COLOR

Each new run, a new color is shown.

rgb code hexadecimal color
53, 72, 152#354898
ed48

AVAILABLE "imagick" COLORSPACE CONSTANTS
STUDIED IN THIS TUTORIAL

1810 - ImageMagick 7.1.2-29
COLORSPACE
CONSTANTVALUEABOUT
imagick::COLORSPACE_UNDEFINED0 
imagick::COLORSPACE_RGB21 
imagick::COLORSPACE_GRAY3 
imagick::COLORSPACE_TRANSPARENT24 
imagick::COLORSPACE_OHTA18 
imagick::COLORSPACE_LAB  
imagick::COLORSPACE_XYZ26 
imagick::COLORSPACE_YCBCR27 
imagick::COLORSPACE_YCC28 
imagick::COLORSPACE_YIQ30 
imagick::COLORSPACE_YPBPR31 
imagick::COLORSPACE_YUV32 
imagick::COLORSPACE_CMYK2 
imagick::COLORSPACE_SRGB23 
imagick::COLORSPACE_HSB6 
imagick::COLORSPACE_HSL8 
imagick::COLORSPACE_HWB10 
imagick::COLORSPACE_REC601LUMA  
imagick::COLORSPACE_REC709LUMA  
imagick::COLORSPACE_LOG15 
imagick::COLORSPACE_CMY1 ImageMagick version 6.4.2 or higher.
ed48

  1 EXERCISE   

<?php 

$imagick1 
= new imagick(PATH2IMGW '/jpg/aa.jpg');

$Colorspace1 $imagick1->getImageColorspace();

echo 
"The image Colorspace is " $Colorspace1;

?>

aa.jpg

img/jpg/aa.jpg apr

The Colorspace is 23

  2 EXERCISE   

<?php 

$imagick2 
= new imagick(PATH2IMGW '/gif/E 01 01.gif');

$Colorspace2 $imagick2->getImageColorspace();

echo 
"The image Colorspace is " $Colorspace2;

?>

E 01 01.gif

img/gif/E 01 01.gif apr

The Colorspace is 23

  3 EXERCISE   

<?php 

$imagick3 
= new imagick(PATH2IMGW '/others/Image1.jpg');

$Colorspace3 $imagick3->getImageColorspace();

echo 
"The image Colorspace is " $Colorspace3;

?>

Image1.jpg

img/others/Image1.jpg apr

The Colorspace is 3