for X := 0 to tmpBit.Width - 1 do begin for Y := 0 to tmpBit.Height - 1 do begin R := GetRValue(tmpBit.Canvas.Pixels[X, Y]); G := GetGValue(tmpBit.Canvas.Pixels[X, Y]); B := GetBValue(tmpBit.Canvas.Pixels[X, Y]); if RGB(RGB)=clwhite then A := 255 else A := 0; SourceBmp.SetPixel(X, Y, MakeColor(A, R, G, B)); end; end; Bitmap.Free;