Skip to content

Instantly share code, notes, and snippets.

@dchawisher
dchawisher / tear.scm
Last active July 8, 2023 21:29
GIMP Plugin for "torn paper" effect
(define (tear image drawable)
(gimp-image-undo-group-start image)
(let* (
(backdrop (car (gimp-layer-new image (car (gimp-image-width image)) (car (gimp-image-height image)) RGBA-IMAGE "Torn Paper Scratch Layer" 100 NORMAL-MODE)))
(source (car (gimp-layer-copy drawable TRUE)))
(twidth (car (gimp-image-width image)))
(tscale0 (* twidth 0.002))
(tscale1 (* twidth 0.001))
(tscale2 (* twidth 0.001))
(tscale3 (* twidth 0.003))