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
101, 212, 31#65d41f
ed48

AVAILABLE "imagick" COLORSPACE CONSTANTS
STUDIED IN THIS TUTORIAL

1690 - ImageMagick 6.9.10-6
COLORSPACE
CONSTANTVALUEABOUT
imagick::COLORSPACE_UNDEFINED0 
imagick::COLORSPACE_RGB1 
imagick::COLORSPACE_GRAY2 
imagick::COLORSPACE_TRANSPARENT3 
imagick::COLORSPACE_OHTA4 
imagick::COLORSPACE_LAB 5  
imagick::COLORSPACE_XYZ6 
imagick::COLORSPACE_YCBCR7 
imagick::COLORSPACE_YCC8 
imagick::COLORSPACE_YIQ9 
imagick::COLORSPACE_YPBPR10 
imagick::COLORSPACE_YUV11 
imagick::COLORSPACE_CMYK12 
imagick::COLORSPACE_SRGB13 
imagick::COLORSPACE_HSB14 
imagick::COLORSPACE_HSL15 
imagick::COLORSPACE_HWB16 
imagick::COLORSPACE_REC601LUMA 17  
imagick::COLORSPACE_REC709LUMA 19  
imagick::COLORSPACE_LOG21 
imagick::COLORSPACE_CMY22 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