Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Bitmap-Histogram/Zkl/bitmap-histogram-2.zkl
Normal file
10
Task/Bitmap-Histogram/Zkl/bitmap-histogram-2.zkl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
img:=PPM.readPPMFile("lenaGrey.ppm"); // a grey scale image
|
||||
median:=histogramMedian(histogram(img));
|
||||
median.println();
|
||||
|
||||
bw:=PPM(img.w,img.h);
|
||||
// stream bytes from orginal, convert to black/white, write to new image
|
||||
// each pixel is 24 bit RGB
|
||||
img.data.pump(bw.data.clear(),'wrap(c){ if(c>median) 0xff else 0 });
|
||||
|
||||
bw.write(File("foo.ppm","wb"));
|
||||
Loading…
Add table
Add a link
Reference in a new issue