Change language

PHP Imagick montageImage () function

Syntax:
Imagick Imagick::montageImage (ImagickDraw $draw, string  $tile_geometry, string $thumbnail_geometry, int $mode, string $frame)
Parameters: This function takes five parameters as above and described below:
  • $draw:defines the name, size and color of the font.
  • $tile_geometry:defines the number of tiles per line and page.
  • $thumbnail_geometry:defines the preferred image size and border size for each thumbnail.
  • $mode:contains an integer value corresponding to one of MONTAGEMODE constants .
  • $frame:Indicates whether the image is surrounded by an ornamental frame.
List of all constants M ONTAGEMODE is shown below:
  • imagick::MONTAGEMODE_FRAME (1)
  • imagick::MONTAGEMODE_UNFRAME (2)
  • imagick::MONTAGEMODE_CONCATENATE (3)
Return Value:This function returns a new Imagick object on success.Exceptions:This function throws ImagickException on error.The following programs illustrate the Imagick::montageImage() functionin PHP:Program 1:  
// Create a new Imagick object $imagick = new Imagick ( https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png );  
// Create edit $result = $imagick -> montageImage ( new ImagickDraw(), ’4x2’ , ’150x100 + 2 + 2 ’ , imagick::MONTAGEMODE_UNFRAME, " 2x2 + 3 + 3 " );  
// Show image $result -> setImageFormat ( ’png’ ); header ( "Content-Type: image / png" ); echo $result -> getImageBlob(); ?>
Output: Program 2:  
// Create new Imagick object $imagick = new Imagick();  
// Create a new tagged image $imagick -> newimage (1000, 800, ’green’ ); $imagick -> labelImage ( ’green’ );  
// Add a new tagged image $imagick -> addImage ( new imagick ( https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png )); $imagick -> labelImage ( ’ Image1’ );  
// Add a new tagged image $imagick -> addImage ( new imagick ( https://media.engineerforengineer.org/wp-content/uploads/20190918234528/colorize1.png )); $imagick -> labelImage ( ’ Image2’ );  
// Create a new tagged image $imagick -> newimage (1000, 800, ’blue’ ); $imagick -> labelImage ( ’blue’ );  
// Create a new tagged image $imagick -> newimage (1000, 800, ’violet’ ); $imagick -> labelImage ( ’violet’ );  
// Create a new tagged image $imagick -> newimage (1000, 800, ’cyan’ ); $imagick -> labelImage ( ’cyan’ );  
// Create edit $result = $imagick -> montageImage ( new ImagickDraw(), "3x2 + 0 +0 " , " 200x160 + 3 + 3 > " , Imagick::MONTAGEMODE_CONCATENATE, " 10x10 + 2 + 2 " );  
// Show image $result -> setImageFormat ( ’png’ ); header ( "Content-Type: image / png" ); echo $result -> getImageBlob(); ?>
Output: Link: https://www.php.net/manual/en/imagick.montageimage.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