Is it possible to do additive blending with matplotlib?

If you only need an image as the result, you can get the canvas buffer as a numpy array, and then do the blending, here is an example: from matplotlib import pyplot as plt import numpy as np fig, ax = plt.subplots() ax.scatter(x1,y1,c=”b”,edgecolors=”none”) ax.set_xlim(-4, 4) ax.set_ylim(-4, 4) ax.patch.set_facecolor(“none”) ax.patch.set_edgecolor(“none”) fig.canvas.draw() w, h = fig.canvas.get_width_height() img … Read more

Are photoshop-like blend modes possible in HTML5?

I have created a separate, lightweight, open-source library for perform Photoshop-style blend modes from one HTML Canvas context to another: context-blender. Here’s the sample usage: // Might be an ‘offscreen’ canvas var over = someCanvas.getContext(‘2d’); var under = anotherCanvas.getContext(‘2d’); over.blendOnto( under, ‘screen’, {destX:30,destY:15} ); See the README for more information, including the currently-supported blend modes. … Read more

Is there an algorithm for color mixing that works like mixing real colors?

The correct answer is NO, because there is no correct working model of how “color mixing in the real world” really works. It is FAR too complex and conditional and not really at all like the simple Red-Blue-Yellow stuff that we learned in school (it in fact requires all of Chemistry and a lot of … Read more

tech