isoblend
v0.1.1
Published
ISO Blend Modes
Downloads
4
Readme
isoblend
PDF Blend modes as defined by the Adobe® Supplement to the ISO 32000/-1
Optimised RGBA blend functions performing blend operations based on the PDF
/ Adobe® Photoshop® blend modes. The functions are designed to work with the
pixel format of an ImageData
object, where pixel values are stored as
[R, G, B, A, R, G, B, A, R, G, B, A, ... ]
Each blend function takes src, dst and out array, where
src
is the image on topdst
is the image underneathout
is the array in which to write the result of the operation
The following RGBA blend modes are supported
- Normal
isoblend/normal
- Compatible
isoblend/compatible
- Multiply
isoblend/multiply
- Screen
isoblend/screen
- Overlay
isoblend/overlay
- Darken
isoblend/darken
- Lighten
isoblend/lighten
- ColorDodge*
isoblend/dodge
- ColorBurn*
isoblend/burn
- HardLight
isoblend/hardlight
- SoftLight
isoblend/softlight
- Difference
isoblend/difference
- Exclusion
isoblend/exclusion
*Based on extension level 5
Adobe® Supplement to the ISO 32000 Base Version: 1.7 Extension Level: 3
Adobe® Supplement to ISO 32000-1 Base Version: 1.7 Extension Level: 5
Example
var isoblend = require("isoblend")
var src = [0.1, 0.5, 0.7, 0.9, 0.1, 0.5, 0.7, 0.9] // 2 pixels [RGBARGBA]
var dst = [0.5, 0.4, 0.3, 0.4, 0.9, 0.2, 0.5, 0.8] // 2 pixels to blend over
var out = []
iso.normal(src, dst, out)
// out contains the result after blending src on top of dst using normal blend
Installation
npm install isoblend
Contributors
- Matt-Esch