Re: Comparing NSImages
Re: Comparing NSImages
- Subject: Re: Comparing NSImages
- From: Greg Guerin <email@hidden>
- Date: Thu, 23 Jul 2009 14:39:29 -0700
Benjamin Rister wrote:
Question 2: Assuming TIFFRepresentation isn't unique, what's the
best practice to verify programmatically, say in a unit test, that
the output matches an expected output?
Subtract the test's output image from the reference image, pixel by
pixel, and look for any non-zero differences. This assumes
compatible representations and no differences introduced by any other
image-handling steps (e.g. device-RGB is device-dependent, so can't
be assumed to be unvarying).
Even so, you might encounter small non-zero differences that
originate from outside your code-under-test. If these are larger
than +/-1 they could be significant; +/-1 I'd probably accept as
within the margin-of-error for rounding.
-- GG
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden