RosettaCodeData/Task/Grayscale-image/PL-I/grayscale-image.pli
2023-07-01 13:44:08 -04: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;