var x, y: integer;
r, b, g: byte;
begin
with Digilabel.canvas
do
begin
for x:=1
to Digilabel.Width-1
do
for Y:=1
to Digilabel.height-1
do
begin
r:=(GetRValue(Pixels[x-1,y-1])+
GetRValue(Pixels[x,y-1])+
GetRValue(Pixels[x+1,y-1])+
GetRValue(Pixels[x-1,y])+
GetRValue(Pixels[x+1,y])+
GetRValue(Pixels[x-1,y+1])+
GetRValue(Pixels[x,y+1])+
GetRValue(Pixels[x+1,y+1])+
GetRValue(Pixels[x,y]))
div 9;
g:=(GetGValue(Pixels[x-1,y-1])+
GetGValue(Pixels[x,y-1])+
GetGValue(Pixels[x+1,y-1])+
GetGValue(Pixels[x-1,y])+
GetGValue(Pixels[x+1,y])+
GetGValue(Pixels[x-1,y+1])+
GetGValue(Pixels[x,y+1])+
GetGValue(Pixels[x+1,y+1])+
GetGValue(Pixels[x,y]))
div 9;
b:=(GetBValue(Pixels[x-1,y-1])+
GetBValue(Pixels[x,y-1])+
GetBValue(Pixels[x+1,y-1])+
GetBValue(Pixels[x-1,y])+
GetBValue(Pixels[x+1,y])+
GetBValue(Pixels[x-1,y+1])+
GetBValue(Pixels[x,y+1])+
GetBValue(Pixels[x+1,y+1])+
GetBValue(Pixels[x,y]))
DIV 9;
Pixels[x,y]:=
RGB(r,g,b);
end;
end;