Skip to content
Advertisement

PHP (ImageMagick) – Merge images from source data

I have an array of valid image sources and I want to merge them horizontally using ImageMagick in PHP.

Code:

JavaScript

The result is black background with white square

Expected result: 4 .png images merged into 1 presenting people.

Advertisement

Answer

My solution:

$imagePartsData is an array of image sources sorted from left to right so in for loop it adds images properly.

JavaScript

The result is expected! The picture (result.png) of people merged from 4 equal size images.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement