grafX2/share/grafx2/scripts/bru_db_GrayscaleAvg.lua
Yves Rizoud 3ca5322379 Reorganized source code and directory tree.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1375 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-03-05 02:53:19 +00:00

19 lines
286 B
Lua

--BRUSH Remap: Grayscale (average)
--by Richard Fhager
--http://hem.fyristorg.com/dawnbringer/
w, h = getbrushsize()
for x = 0, w - 1, 1 do
for y = 0, h - 1, 1 do
r, g, b = getcolor(getbrushpixel(x,y))
a = (r+g+b)/3
putbrushpixel(x, y, matchcolor(a,a,a));
end
end