Hey everybody,
I'm checking out P5.js the first time now and I'm really impressed. Can somebody give me some feedback about if applying a blur filter to an image is possible in in P5.js at the moment?
Hi KevinWorkman. Cheers for the reference, but I'm talking about P5.js not Processing.js. I know it's confusing, so this is a link to the P5.js
Image reference: http://p5js.org/reference/#/p5/filter
There are several blur implementations in the forum, search from the main site to find more hits...
Of course, you will only find Java implementations, but adapting to JS shouldn't be too hard.
Answers
Possible? Sure. You can do pretty much anything you want with images, since you can access the pixel array directly.
Check out the PImage reference: http://processingjs.org/reference/PImage/
I recommend just trying something out and posting an MCVE if you get stuck on something specific.
Hi KevinWorkman. Cheers for the reference, but I'm talking about P5.js not Processing.js. I know it's confusing, so this is a link to the P5.js Image reference: http://p5js.org/reference/#/p5/filter
Unfortunately no Blur is listed in there..
Interesting, I don't really know much about P5.js.
But looking at their reference, they also have an Image API that gives you access to the pixels directly:
http://p5js.org/reference/#/p5.Image
Presumably you'd be able to take those pixels and do whatever you want with them, including applying whatever blur filter you want.
I'm not sure you'll find a basic blur() function, but it shouldn't be too hard to implement one.
There are several blur implementations in the forum, search from the main site to find more hits...
Of course, you will only find Java implementations, but adapting to JS shouldn't be too hard.
It's implemented, but not in the reference yet. As it seems nobody has a clue here:
It's extremely more convenient relying on preload() to loadImage() than setting up a callback
function
: :Dhttp://p5js.org/reference/#/p5/preload