shithub: pico

ref: 0d63c6d2a5b5bc61213fd2e7ccf6779a7c789780
dir: /examples/

View raw version
; hget http://9front.org/img/9bind.png | png -t9 > /tmp/bind
; hget http://9front.org/img/ninefront.bit > /tmp/nine
; pico
# combining two images
-> r nine /tmp/nine
-> r bind /tmp/bind
-> bind + (y > 100 ? nine[x,y-100,z] : 0)
# extract red and alpha channels
-> z == 3 ? bind : z == 0 ? bind : 0
# halve color intensity
-> z < 3 ? bind/2 : Z
# set black pixels' alpha to 0
-> bind[x,y,0] + bind[x,y,1] + bind[x,y,2] == 0 && z == 3 ? 0 : bind
# set black pixels to cyan
bind[x,y,0] + bind[x,y,1] + bind[x,y,2] == 0 ? z == 0 ? 0 : z == 1 ? Z : z == 2 ? Z : bind : bind
# doug demo
-> lerp = z != 3 ? (x < X/3 ? 0 : x > 2*X/3 ? 255 : (x-X/3)*Z/(X/3)) : Z
-> rbind = bind[X-x,y,z]
-> z != 3 ? (bind*lerp+rbind*(Z-lerp))/Z : Z
-> z != 3 ? (rbind*lerp+bind*(Z-lerp))/Z : Z