Add S-expression based video effects pipeline with modular effect definitions, constructs, and recipe files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
12 lines
355 B
Common Lisp
12 lines
355 B
Common Lisp
;; Posterize effect - reduces color levels
|
|
;; @param levels int [2, 32] default 8
|
|
|
|
(define-effect posterize
|
|
((levels 8))
|
|
(let ((step (floor (/ 256 levels))))
|
|
(map-pixels frame
|
|
(lambda (x y c)
|
|
(rgb (* (floor (/ (red c) step)) step)
|
|
(* (floor (/ (green c) step)) step)
|
|
(* (floor (/ (blue c) step)) step))))))
|