Grayscale image: Difference between revisions

Add Factor
No edit summary
(Add Factor)
Line 553:
return image
end function</lang>
 
=={{header|Factor}}==
{{works with|Factor|0.99 2020-07-03}}
<lang factor>USING: arrays kernel math math.matrices math.vectors ;
 
: rgb>gray ( matrix -- new-matrix )
[ { 0.2126 0.7152 0.0722 } vdot >integer ] matrix-map ;
 
: gray>rgb ( matrix -- new-matrix )
[ dup dup 3array ] matrix-map ;</lang>
 
=={{header|FBSL}}==
1,808

edits