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-08-13 02:32:41 +00:00
|
|
|
let path = newPath()
|
|
|
|
path.polygon(vec2(100, 100), 70, sides = 6)
|
|
|
|
|
2022-07-26 02:00:30 +00:00
|
|
|
let mask = newImage(200, 200)
|
|
|
|
mask.fillPath(path, color(1, 1, 1, 1))
|
2021-01-29 20:17:24 +00:00
|
|
|
|
2020-12-04 17:43:33 +00:00
|
|
|
blur.blur(20)
|
2022-02-14 04:02:37 +00:00
|
|
|
blur.draw(mask, blendMode = MaskBlend)
|
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")
|