2021-02-18 19:39:11 +00:00
|
|
|
import pixie
|
2020-12-04 16:32:03 +00:00
|
|
|
|
2021-01-29 20:17:24 +00:00
|
|
|
let
|
|
|
|
trees = readImage("examples/data/trees.png")
|
|
|
|
blur = trees.copy()
|
|
|
|
image = newImage(200, 200)
|
|
|
|
|
2020-12-04 17:32:38 +00:00
|
|
|
image.fill(rgba(255, 255, 255, 255))
|
2020-12-04 17:25:00 +00:00
|
|
|
|
2021-02-09 04:50:39 +00:00
|
|
|
let mask = newMask(200, 200)
|
2021-02-19 18:04:27 +00:00
|
|
|
mask.fillPolygon(vec2(100, 100), 70, sides = 6)
|
2021-01-29 20:17:24 +00:00
|
|
|
|
2020-12-04 17:43:33 +00:00
|
|
|
blur.blur(20)
|
2020-12-04 16:32:03 +00:00
|
|
|
blur.draw(mask, blendMode = bmMask)
|
2021-01-29 20:17:24 +00:00
|
|
|
|
2020-12-04 16:32:03 +00:00
|
|
|
image.draw(trees)
|
|
|
|
image.draw(blur)
|
|
|
|
|
|
|
|
image.writeFile("examples/blur.png")
|