Skip to content

Commit c7a0291

Browse files
gh-108: Make image.INVERT preserve alpha.
1 parent 7fd4eed commit c7a0291

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/std/image/init.pre

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ FUNC TNS: FLIP_H(TNS: img){
8080
}
8181

8282
FUNC TNS: INVERT(TNS: img){
83-
RETURN(MSUB(TNS(SHAPE(img), 0xFF), img))
83+
TNS: return = MSUB(TNS(SHAPE(img), 0xFF), img)
84+
return[*, *, 0d4] = img[*, *, 0d4] ! Preserve alpha
85+
POP(return)
8486
}
8587

8688
FUNC TNS: RECT(TNS: img, INT: x, INT: y, INT: width, INT: height, TNS: color, INT: fill, INT: thickness){

0 commit comments

Comments
 (0)