RosettaCodeData/Task/Grayscale-image/J/grayscale-image-1.j
2023-07-01 13:44:08 -04:00

6 lines
232 B
Text

NB. converts the image to grayscale according to formula
NB. L = 0.2126*R + 0.7152*G + 0.0722*B
toGray=: [: <. +/ .*"1&0.2126 0.7152 0.0722
NB. converts grayscale image to the color image, with all channels equal
toColor=: 3 & $"0