Skip to content

Instantly share code, notes, and snippets.

@pattlebass
pattlebass / fast_blur.gd
Last active February 16, 2023 17:17
A fast blurring algorithm in GDScript
# This is not _optimized_ for GDScript, but it works
# Adapted from: stackoverflow.com/q/21418892/understanding-super-fast-blur-algorithm
func fast_blur(img: Image, radius: int) -> Image:
if radius < 1:
return img
var w: int = img.get_width()
var h: int = img.get_height()
var wm: int = w - 1