New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

compositr

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compositr

Use canvas to easily composite images. Supports file uploading and image URLs.

  • 0.9.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

Compositr 🌆 + 🌅 = 🌇

Code
Climate

Use canvas to easily composite images. Supports file uploading and image URLs

Installation

npm install compositr --save

or

yarn add compositr

Example

See /example

Usage

  const canvas = document.querySelector('canvas')
  const imageElement = document.querySelector('img')
  const compositr = new Compositr(canvas)
  compositr.draw([
    { image: 'someImage.png', operation: 'screen' },
    { image: imageElement },
    { image: imageLoadPromise, operation: 'source-over', opacity: 0.8 }
  ])

With HTMLImageElement:

  var canvas = document.querySelector('canvas');
  var input = document.querySelector('input');
  var compositr = new Compositr(canvas);
  var onFileUpload = compositr.drawOnUpload([
    { image: undefined, operation: 'screen' },
    { image: compositr.load('images/CTEMF-foreground-01.png'), operation: 'source-over' },
    { image: compositr.load('images/CTEMF-foreground-02.png'), operation: 'screen' },
    { image: compositr.load('images/CTEMF-logo.png'), operation: 'source-over' },
  ]);
  input.addEventListener('change', onFileUpload);

##TODO ###Readme

  • Screenshot with usage / example
  • Note about resetting opacity but not operation
  • Full API
  • Link to supported operations

###Library

  • Compositr.draw and Compositr.drawOnUpload should return a promise
  • Universal!
  • Responsiveness option
  • Better support for different canvas sizes

License

Compositr is © 2017 MADE Code PTY Ltd. It is free software, and may be redistributed under the terms specified in the LICENSE file.

Maintained by

madeagency

Compositr was created and is maintained MADE Code PTY Ltd. The names and logos for MADE Code are trademarks of MADE Code PTY Ltd.

We love open source software. See our Github Profile for more.

We're always looking for talented people who love programming. Get in touch with us.

Keywords

FAQs

Package last updated on 14 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc