Catalog npm
Back to packageRELEASE DETAILS

1.2.5

npm

1ro

Combine multiple images into a single image

Published30 Sept 2021
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

combine-image

NPM

Combine multiple images into a single image

combine-image combines given images into a single image in right order. This will be helpful in a situation when you have to generate a preview of multiple images into a single image. This module is based on [Jimp] for image processing.

Install

$ npm install combine-image

Usage

import combineImage from 'combine-image';

combineImage(['image-1.png', 'image-2.jpg'])
  .then((img) => {
    // Save image as file
    img.write('out.png', () => console.log('done'));
  });

API

combineImage(images[, options])

  • images Array of (String | Object | Buffer | [Jimp]) - List of images to concat. If String is passed, it will be considered to the file path. Also you can pass other [Jimp] object. An Object entry can have following options:
    • src String or Buffer - A single image source to concat.
    • offsetX Number (optional) - x offset to affect this image. Default is 0.
    • offsetY Number (optional) - y offset to affect this image. Default is 0.
  • options Object (optional)
    • direction String - Direction of the merged image. If this value is col, the images will be merged vertically (col). Otherwise, If this value is row the images will be merged horizontally (row). Default is col.
    • color Number (hex) - Default background color represented by RGBA hex value. Default is 0x00000000.
    • offset Number - Offset in pixels between each image. Default is 0.
    • margin (Number | String | Object) - Margin of the result image. If Number or String is passed, it will be considered as standard css shorthand properties (e.g. '40 40 0 10'). An Object entry can have following options:
      • top Number (optional) - Margin on top side of result image. Default is 0.
      • right Number (optional) - Margin on right side of result image. Default is 0.
      • bottom Number (optional) - Margin on bottom side of result image. Default is 0.
      • left Number (optional) - Margin on left side of result image. Default is 0.

Returns a Promise that contains [Jimp] object.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
is-plain-obj
Environment
{
  "local_name": "is-plain-obj",
  "alias": false,
  "peer_metadata": null
}
^1.1.0runtime
jimp
Environment
{
  "local_name": "jimp",
  "alias": false,
  "peer_metadata": null
}
0.2.27runtime
babel-cli
Environment
{
  "local_name": "babel-cli",
  "alias": false,
  "peer_metadata": null
}
^6.26.0development
babel-plugin-add-module-exports
Environment
{
  "local_name": "babel-plugin-add-module-exports",
  "alias": false,
  "peer_metadata": null
}
^0.2.1development
babel-preset-env
Environment
{
  "local_name": "babel-preset-env",
  "alias": false,
  "peer_metadata": null
}
^1.6.0development
babel-preset-stage-1
Environment
{
  "local_name": "babel-preset-stage-1",
  "alias": false,
  "peer_metadata": null
}
^6.24.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-NOzi60gJlI8na93396JWnZD/7wldVAabYMxvjI02ZK1kys026S8C2NzvHseuH78j1vLjpS3XhR/IkVxGB0AYvg==",
  "shasum": "9e1094eb34f9ac66eed4fabf0b833adc6d754960",
  "tarball": "https://registry.npmjs.org/1ro/-/1ro-1.2.5.tgz",
  "fileCount": 54,
  "unpackedSize": 63070,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhueYDCRA9TVsSAnZWagAASxAP/RiW9Fad17eQwCLMk/4A\n/LVb2RiOk7azkkH97wjpIZxbZO/Hi49ord9X9hFYEswG+ULgkr01d1sKpBJg\nWrNzx4bln6WpU+8/CyiiduEVvA05zufvfzrC4AT5IfWoPSjK7Yo45sgwGBaZ\noXkjVN29roFA1JCTqUpsIOvJ/cX5/qPEimPteu/bimh9jbSr8VKQqJ0JVMuw\nZRlTD2f0PQ0OxmziY91Ud+/0+hqRXeECwTghOqkqRbL1+1xdSvuh4wV4wU7G\nany0n3EzSr718sj8h18BBKkwD94e+paxLeS4WXmalm5Gi7/6cxLcFKxtFafA\nDkFNfIutXL0P2UD1Mkkg0/hCcAus+O3iCKLjm72JjhqAdFZtBbSl80T3xMDm\n+Jk3AO58yssP7WSQRkOXa2K4X+6RmNyGFicM/qvLWWvma7gBlHe5o/CLjIa8\nRjbmglhyKyEZ0tECWpsygjNalwqNgWNiYgoh/0Y2kH7ovRk3/kZIH161lJ+8\nti4LxFC6ysV6HDEtPQeIC0RKc2DTLJNMaMReXhp2LOpyaxH5aSPu4NmURExN\npM3OpXOXVtHpi/SuQ2+DHfWfu/7elQ/zClLSJpBeq2ELpPLajP+f+159tUBJ\naZbfVVk3wat3IbDsBhhvjGAzd+FupZgTTTknNXjYiRv71w8hxKhZj/YNL9HB\nOpbx\r\n=PNmX\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQCg7Wir1SkHNmTYInMi6flBQTXWWs/gN9NeCJVcpuH/mAIgI/p4ud/xYOH74YvLteJ/x0gOt/nMjZVmXJbS+C1mdv0="
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:6762fb69cd9030b419f08f1610b8a7fb3e0d6a2a7e92a0aae46b76eba26f667f

Other collected versions

1.2.321 Jan1.2.221 Jan1.2.121 Jan1.2.021 Jan1.0.920 Jan1.0.820 JanView all collected versions →