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,19 @@
on rgbToGrayscaleImageFast (img)
res = image(img.width, img.height, 8)
res.paletteRef = #grayScale
res.copyPixels(img, img.rect, img.rect)
return res
end
on rgbToGrayscaleImageCustom (img)
res = image(img.width, img.height, 8)
res.paletteRef = #grayScale
repeat with x = 0 to img.width-1
repeat with y = 0 to img.height-1
c = img.getPixel(x,y)
n = c.red*0.2126 + c.green*0.7152 + c.blue*0.0722
res.setPixel(x,y, color(256-n))
end repeat
end repeat
return res
end