Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

1ro

Combine multiple images into a single image

Published20 Jan 2021
Direct dependencies22
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 22

Native requirements
22 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@cfworker/json-schema
Environment
{
  "local_name": "@cfworker/json-schema",
  "alias": false,
  "peer_metadata": null
}
^1.6.5runtime
@cfworker/worker-types
Environment
{
  "local_name": "@cfworker/worker-types",
  "alias": false,
  "peer_metadata": null
}
^1.6.0runtime
@cloudflare/workers-types
Environment
{
  "local_name": "@cloudflare/workers-types",
  "alias": false,
  "peer_metadata": null
}
^2.0.0runtime
@types/cookie
Environment
{
  "local_name": "@types/cookie",
  "alias": false,
  "peer_metadata": null
}
^0.4.0runtime
@types/escape-html
Environment
{
  "local_name": "@types/escape-html",
  "alias": false,
  "peer_metadata": null
}
^1.0.0runtime
@types/koa-compose
Environment
{
  "local_name": "@types/koa-compose",
  "alias": false,
  "peer_metadata": null
}
3.2.5runtime
@types/secure-json-parse
Environment
{
  "local_name": "@types/secure-json-parse",
  "alias": false,
  "peer_metadata": null
}
^1.0.2runtime
@types/statuses
Environment
{
  "local_name": "@types/statuses",
  "alias": false,
  "peer_metadata": null
}
^1.5.0runtime
cookie
Environment
{
  "local_name": "cookie",
  "alias": false,
  "peer_metadata": null
}
^0.4.1runtime
escape-html
Environment
{
  "local_name": "escape-html",
  "alias": false,
  "peer_metadata": null
}
^1.0.3runtime
koa-compose
Environment
{
  "local_name": "koa-compose",
  "alias": false,
  "peer_metadata": null
}
^4.1.0runtime
negotiator
Environment
{
  "local_name": "negotiator",
  "alias": false,
  "peer_metadata": null
}
^0.6.2runtime
path-to-regexp
Environment
{
  "local_name": "path-to-regexp",
  "alias": false,
  "peer_metadata": null
}
^6.2.0runtime
secure-json-parse
Environment
{
  "local_name": "secure-json-parse",
  "alias": false,
  "peer_metadata": null
}
^2.1.0runtime
statuses
Environment
{
  "local_name": "statuses",
  "alias": false,
  "peer_metadata": null
}
^1.5.0runtime
@cfworker/dev
Environment
{
  "local_name": "@cfworker/dev",
  "alias": false,
  "peer_metadata": null
}
^1.6.5development
@types/chai
Environment
{
  "local_name": "@types/chai",
  "alias": false,
  "peer_metadata": null
}
^4.2.12development
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
^8.0.3development
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.2.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^8.1.3development
qs
Environment
{
  "local_name": "qs",
  "alias": false,
  "peer_metadata": null
}
^6.9.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.0.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-HjuGBLTJ6QxBHC49cV2enBlQssmOD7T4/nMmh/356yHFTo4gkyIou7ZpOzl84m4roQC8yU6OgGQVdkWA6R0DNg==",
  "shasum": "40c470e6a2e00d0d3572e84bb9a5a7b940685623",
  "tarball": "https://registry.npmjs.org/1ro/-/1ro-1.0.0.tgz",
  "fileCount": 40,
  "unpackedSize": 47372,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCEvXCRA9TVsSAnZWagAADOQP/i2fajrwKBS0lwM/QwR/\nnsJ8dHru3ZdUM0ENl5+8zPbysWkgdyftxtfzgEZITCuwbKVDWQLv/rWNBzeB\nhNit3lF8vP6MQYwi+KKlw3EUsq6JqeURw7PWBYUBt17T/lGDVfsrN7WkrRyu\ne2GpQQD1sKjW8Lt0pYr0LDAM3mcCcQAVVrHqgS7HJ7d7v8dlOwE500CjqmX1\nWjBwNGWkgHWkvwZl5SazebdkXKzMuMh3oFv2SeQBy6Vvvd/8x0Rc2H26fKc8\nfF87oKEMkE6S6C1jib6K15dpsm9ku5yS539TV/xkmLtGZ9I/Syf3VxFhdzbW\nIVbvZtmG62uM0hRL9TJ/OFmFkbayWiGqnB2NsqGu0blDyOpnbOS9jK7xScDz\nWtztJ5VQv4BFk5kcs5/uebPmS+thGY/CJ4BzgtgO5j5CipkNua4ebV488N98\nWa60lVOk5obSiacJky2poMd9pdjb+t3asT6g6VavH/KCa3TDXSBCDyL0sMLY\na0ST4ms0G44q4w5FXwHdYZL0/C/PLQIuZwt6MkwvCUt0uopkCWHKL+9SjweF\nFWLXoE/Z7KVj6MksffP4gyyZ5oxylSftEdTcyFJ80wrTEK7iaAYIffySRkPD\npWumFWNK9zhI3thZXz7fASHIFdqrqnbhXBC5c3sKOkq2DXCG7lmobyXeBLNh\nH6wT\r\n=288W\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCP5VAduZqacXRpsPqanp+TdXJX1BPR44b9LvxW4OgDQgIhAO7aSg5q+hmN6sir/WSZNeINo4p0Ifa4zTbb48nFgMjN"
    }
  ]
}

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:aa336faed9b9b002452bd549cdb896c4d513dcbc070f24f60f3308d6979f42ff

Other collected versions

1.2.530 Sept1.2.321 Jan1.2.221 Jan1.2.121 Jan1.2.021 Jan1.0.920 JanView all collected versions →