很古老的问题了,给你最通用的方法:
procedure TForm1.btn1Click(Sender: TObject);
var
i , k : Integer;
begin
for i := 0 to img1.Width -1 do
for k := 0 to img1.Height-1 do
begin
if img1.Canvas.Pixels[i,k] <>img2.Canvas.Pixels[i,k] then
begin
img2.Canvas.Pixels[i,k] := clRed;
end;
end;
end;