Coder Social home page Coder Social logo

image-joiner's Introduction

image-joiner 🖼️

Fast and Easy node.js Image join Tool.

Install

pnpm add sharp image-joiner

Features

  • Based on grid layout
  • Easy and fast ⚡

Usage

import { GridImageJoiner } from 'image-joiner'

const joiner = new GridImageJoiner(2, 2)

joiner.loadImageFromLocal("./image.jpg", {
  row: 0,
  col: 0,
})

joiner.loadImageFromLocal("./image.jpg", {
  row: 1,
  col: 1,
})

joiner
  .draw({
    background_color: { r: 0, g: 122, b: 40, alpha: 0.2},
  })
  .then((image) => image.toFormat('png').toFile('output.png'))

Load image from an existing image object

joiner.loadImageFromObj(image, options)

Grid Item Options

You can specify the row_space and col_space of a grid item

export interface GridItemOption {
  row: number;
  col: number;
  row_space?: number; // default 1
  col_space?: number; // default 1
  order?: number; // default 1
}

Draw Options

export type DrawOptions = {
  resize?: {
    width: number;
    height: number;
  };
  row_gap?: number;
  col_gap?: number;
  background_color?: Color;
}

image-joiner's People

Contributors

lxxorz avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.