Change language

PHP Imagick exportImagePixels () function

|
Syntax:
array Imagick::exportImagePixels ($x, $y, $width, $height, $map, $STORAGE)
Parameters:This function takes six parameters as above and described below:
  • $x:contains x-coordinate of the exported area.
  • $y:contains the y-coordinate of the exported area.
  • $width:contains the width of the exported area .
  • $height:contains the height of the exported area.
  • $map:contains the order of the exported pixels. For example, "RGB". Valid map symbols are R, G, B, A, O, C, Y, M, K, I, and P.
  • $STORAGE:contains pixel type constants.
Returned value:this function returns an array containing pixel values.Program :  
// Create a new Imagick object $image = new Imagick();  
// Use the newPseudoImage() function // create a new image $image -> newPseudoImage (0, 0, "magick: rose" );  
// Using the exportImagePixels() function // export image pixels $pixels = $image -> exportImagePixels (5, 5, 3, 3, " RGB " , Imagick::PIXEL_CHAR);  
// Show output array var_dump ( $pixels );  
?>
Output:
array (27) {[0] = > int (51) [1] = > int (47) [2] = > int (44) [3] = > int (50) [4] = > int (45) [5] = > int (42) [6] = > int (45) [7] = > int (42) [8] = > int (43) [9] = > int (58) [10] = > int (50) [11] = > int (46) [12] = > int (56) [13] = > int (48) [14] = > int (45) [15] = > int (51) [16] = > int (46) [17] = > int (44) [18] = > int (66) [19] = > int (58) [20] = > int (56) [21] = > int (65) [22] = > int (57) [23] = > int (53) [24] = > int (61) [25] = > int (55) [26] = > int (51)}
Link: https://www .php.net / manual / en / imagick.exportimagepixels.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method