Join multiple photos with pure javascript library

Javascript is a programming language for the web. We can use to create very useful things such as libraries, that users can easily use the benefits of this programming language with less code. Today i will show you javascript library for fast joining photos, useful for creating featured images or banners for web sites 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 in the end of the document ( to stop render blocking )

<script type="text/javascript" src="photojoiner.js"></script>
// Array of images, static or dynamically added with .push() method
images = ['',
// Send images array as a parameter, required
    'images' : images

Advanced usage

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


Array of urls. This parameter is required

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


Integer value for height of the container. Default value is 350 that means, the output image will be with height of 350px and pictures will bi 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 i 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

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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s