PHP | Imagick getImageAttribute() Function Last Updated : 15 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::getImageAttribute() function is an inbuilt function in PHP which is used to get the named attribute of a key. Syntax: string Imagick::getImageAttribute( string $key ) Parameters: This function accepts single parameter $key which holds the key value in string format. Return Value: This function returns a string value on success. Below programs illustrate the Imagick::getImageAttribute() function in PHP: Program 1: php <?php // Create a Imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Get the attribute with key 'hello' $attribute = $imagick->getImageAttribute('hello'); echo $attribute; ?> Output: Empty string as it is the default value. Program 2: php <?php // Create a Imagick object $imagick = new Imagick( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set an attribute with key 'hello' $imagick->setImageAttribute('hello', 'world'); // Get the attribute with key 'hello' $attribute = $imagick->getImageAttribute('hello'); echo $attribute; ?> Output: world Reference: https://www.php.net/manual/en/imagick.getimageattribute.php Comment More infoAdvertise with us Next Article PHP | Imagick getImageAttribute() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick getImageMatte() Function The Imagick::getImageMatte() function is an inbuilt function in PHP which is used to get the matte channel of an imagick object.Syntax:Â Â bool Imagick::getImageMatte( void ) Parameters: This function does not accept any parameter.Return Value: This function returns True if image has a matte channel 1 min read PHP | Imagick getImageArtifact() Function The Imagick::getImageArtifact() function is an inbuilt function in PHP which is used to get the image artifact value associated with a artifact name. The main difference between image properties and image artifacts is that the properties are public whereas artifacts are private. Syntax: bool Imagick 1 min read PHP | Imagick getImageType() Function The Imagick::getImageType() function is an inbuilt function in PHP which is used to get the potential image type. Syntax: int Imagick::getImageType( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns an integer value corresponding to one of IMGTYPE co 1 min read PHP | Imagick getImageSignature() Function The Imagick::getImageSignature() function is an inbuilt function in PHP which is used to generate an SHA-256 message digest for an image. Syntax: string Imagick::getImageSignature( void ) Parameters: This function does not accept any parameter. Return Value: This function returns a string of SHA-256 1 min read PHP | Imagick getImageSize() Function The Imagick::getImageSize() function is an inbuilt function in PHP which is used to get the image length in bytes. Syntax: int Imagick::getImageSize( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns an integer value containing the current image size 1 min read Like