You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-21Lines changed: 19 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,15 @@ Adobe® Photoshop® has a variety of helpful [blend modes](http://help.adobe.com
25
25
26
26
## Use
27
27
28
+
### In Node.js
29
+
30
+
npm install context-blender
31
+
32
+
Will install node-canvas, which requires a working Cairo install.
33
+
See https://github.com/Automattic/node-canvas#installation for more details.
34
+
35
+
### In a Web Browser
36
+
28
37
// Likely an 'offscreen' (not in the DOM) canvas
29
38
var over = someCanvas.getContext('2d');
30
39
@@ -46,42 +55,31 @@ Adobe® Photoshop® has a variety of helpful [blend modes](http://help.adobe.com
46
55
The following blend modes work perfectly (or as nearly as the [vagaries of the HTML Canvas](http://stackoverflow.com/questions/4309364/why-does-html-canvas-getimagedata-not-return-the-exact-same-values-that-were-ju) allow):
47
56
48
57
*`normal` (or `src-over`)
58
+
*`src-in`
49
59
*`screen`
50
60
*`multiply`
51
61
*`difference`
62
+
*`exclusion`
52
63
53
-
These blend modes mostly work as intended, but have issues when it comes to dealing with the alpha channel:
54
-
55
-
*`exclusion` - very subtle color differences (slightly too bright) under limited circumstances.
56
-
57
-
*`src-in` - the output of this blend mode is slightly different from the effect
58
-
of applying the transparency of one layer as a mask to another; the difference only appears
59
-
in low-opacity areas, however.
60
-
*
64
+
The following additional blend modes mostly work as intended, but have issues when it comes to dealing with the alpha channel:
0 commit comments