Tuesday, September 24, 2024
Google search engine
HomeLanguagesPHP | Imagick getColorspace() Function

PHP | Imagick getColorspace() Function

The Imagick::getColorspace() function is an inbuilt function in PHP which is used to get the global colorspace value of an image.

Syntax:

int Imagick::getColorspace( void )

Parameters: This function doesn’t accept any parameters.

Return Value: This function returns an integer value which can be compared against COLORSPACE constants.

Below program illustrates the Imagick::getColorspace() function in PHP:

Program:




<?php
  
// Create a new imagick object
$imagick = new Imagick(
  
// Get the colorspace
$colorSpace = $imagick->getColorSpace();
  
// Display the colorspace
echo $colorSpace;
  
?>


Output:

0

Reference: https://www.php.net/manual/en/imagick.getcolorspace.php

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments