p5-node
p5-node copied to clipboard
Tint doesn't seem to work on images
trafficstars
Placing a p.tint above a p.image it results in...
ReferenceError: ImageData is not defined
@andithemudkip Have the same problem. Can you give us an advice?
@galipmedia @Yetispapa The implementation wasn't properly done, The library assumed DataImage exists in node. It's also referenced in many places in the code.
I found a workaround that you might want to use for the time being.
In node_modules/node-p5/index.js:18391
You replace e instanceof ImageData with e.data. the code will look like the following:
return e.data
? e.data
: e.getContext("2d").getImageData(0, 0, e.width, e.height).data;
p5.tint will work again until, hopefully, a new version is released where DataImage is defined/imported.