Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,7 @@
fcn toGrayScale(img){ // in-place conversion
foreach x,y in (img.w,img.h){
r,g,b:=img[x,y].toBigEndian(3);
lum:=(0.2126*r + 0.7152*g + 0.0722*b).toInt();
img[x,y]=((lum*256) + lum)*256 + lum;
}
}

View file

@ -0,0 +1,3 @@
img:=PPM.readPPMFile("lena.ppm");
toGrayScale(img);
img.write(File("foo.ppm","wb"));