Join multiple photos with pure javascript library

Javascript is a programming language for the web. We can use it to create very useful things such as libraries, so users can easily use the benefits of this programming language with less code. Today I will show you a javascript library for fast joining photos, useful for creating featured images or banners for websites like where users can compare two or more mobile phones.

Photojoiner is a javascript lightweight library (880 B) for joining photos. You can use this library without jQuery.

Basic usage

Load photojoiner.js or photojoiner.min.js at the end of the document ( to stop render-blocking )

// Array of images, static or dynamically added with .push() method
const images = ['',
// Send images array as a parameter, required
    'images' : images

Advanced usage

Except for required parameter images, you can pass more parameters to adjust photojoiner


The array of URLs. This parameter is required

   'images' : ['image1.jpg','image2.jpg','image3.jpg']


An integer value for the height of the container. The default value is 350 which means, the output image will be with a height of 350px, and pictures will be scaled to the height

  'images' : ['image1.jpg','image2.jpg','image3.jpg'],
'canvasHeight': 500


HTML dom node. Default is canvas element with id joined. You can send your own canvas element

  'images' : ['image1.jpg','image2.jpg','image3.jpg'],

How many pictures can you join?

You can join unlimited number of pictures. Send urls of the pictures as a parameter, and photojoiner will join all pictures.

Example output with more than two pictures

const images = ['','','','',''];
    'images' : images,

Check how it works here

This library you can download from github


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: