My current implementation works for me, but a bit slow (especially if they are the same):
open System.Drawing
let aresame fp1 fp2 =
let bitmap (f:string) = new Bitmap(f)
let same (bm1:Bitmap) (bm2:Bitmap) =
if bm1.Size <> bm2.Size then
false
else
seq { for x = 0 to bm1.Width - 1 do
for y = 0 to bm1.Height - 1 do
yield bm1.GetPixel(x, y) = bm2.GetPixel(x, y) }
|> Seq.forall id
use bm1 = bitmap fp1
use bm2 = bitmap fp2
same bm1 bm2
source
share