Created
November 19, 2018 22:04
-
-
Save bytezen/b5f34f5cc337baf45ea4f259c399a463 to your computer and use it in GitHub Desktop.
Blur in p5js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var layer, layer2; | |
function setup() { | |
createCanvas(400, 400); | |
// background(200); | |
//Layers = Graphics | |
// the circle on the top | |
layer = createGraphics(100,100); | |
layer.background(255,0); | |
layer.fill(255,0,0,100); | |
layer.noStroke(); | |
layer.ellipse(50,50,60,60); | |
// // pg.filter(BLUR,5); | |
//This is the blurred version of the same circle that is on the bottom | |
layer2 = createGraphics(100,100); | |
layer2.background(255,0); | |
layer2.fill('red'); | |
layer2.noStroke(); | |
layer2.ellipse(50,50,80,80); | |
layer2.filter(BLUR,10) | |
} | |
function draw() { | |
background(0); | |
blendMode(HARD_LIGHT); | |
image(layer2,150,150,100,100); | |
image(layer,150,150,100,100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment