RosettaCodeData/Task/Grayscale-image/PL-I/grayscale-image.pli
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

11 lines
330 B
Text

do j = 1 to hbound(image,1);
do i = 0 to hbound(image,2);
color = image(i,j);
R = substr(color, 17, 8);
G = substr(color, 9, 8);
B = substr(color, 1, 8);
grey = trunc(0.2126*R + 0.7152*G + 0.0722*B);
greybits = grey;
image(i,j) = substr(greybits, length(greybits)-7, 8);
end;
end;