type
pRGBArray = ^TRGBArray;
TRGBArray = Array[0..MaxPixelCount-1]Of TRGBTriple;
procedure trid;
var
Orig,Dest:pRgBArray;
begin
for i:=0 to OrigImage.Picture.BitMap.Height-1 do
begin
Orig:=Origimage.picture.bitmap.Scanline[i];
dest:=Destimage.picture.bitmap.scanline[i];
if j:=0 to origimage.picture.bitmap.width-1 do
begin
if Orig[j].rgbtRed=Dest[j].rgbtRed then
...
if Orig[j].rgbtgreen=Dest[j].rgbtgreen then
...
if Orig[j].rgbtblue=Dest[j].rgbtblue then
...