0.3.0 • Published 3 years ago

purified-image v0.3.0

Weekly downloads
26
License
MIT
Repository
github
Last release
3 years ago

node-purified-image

Build Status npm version

Description

Load, save and draw with API similar to HTML Canvas Context 2D. No native dependencies. Wrap PureImage library.

Requirements

  • node >= 8

PureImage

PureImage is a pure JavaScript implementation of image drawing and encoding API, based on HTML Canvas, for NodeJS. It has no native dependencies.

Current features:

  • set pixels
  • stroke and fill paths (rectangles, lines, quadratic curves, bezier curves, arcs/circles)
  • copy and scale images (nearest neighbor)
  • import and export JPG and PNG from streams using promises
  • render basic text (no bold or italics yet)
  • anti-aliased strokes and fills
  • transforms
  • standard globalAlpha and rgba() alpha compositing
  • clip shapes

Installation

Install with npm:

npm install purified-image

Usage

const Image = require('purified-image');

let image = new Image('img/template.png');
image
  .loadFont('/res/OpenSans.ttf')
  .draw(ctx => {
    ctx.fillStyle = '#000000';
    ctx.font = '20 Open Sans';
    ctx.fillText('example', 30, 30);
  })
  .save('out.jpg')
  .then(() => console.log('saved'));

API

class Image

License

Licensed under MIT.

0.3.0

3 years ago

0.2.0

5 years ago

0.1.10

7 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago