as far as i can see the part you marked is ConvertBitmapToGrayscale
if not you can play with theis part of the Code
Delphi-Quellcode:
for x := 0 to bmp.Width - 1 do
begin
pscanLine[x].rgbBlue := 0;
pscanLine[x].rgbGreen := GetDoubleByte(pscanLine[x].rgbGreen);
end;