[Mono-devel-list] System.Drawing Tests - image recognitionsimilarities

Jonathan Gilbert 2a5gjx302 at sneakemail.com
Mon May 30 15:56:08 EDT 2005

At 11:05 AM 30/05/2005 +0300, Mizrahi Rafael wrote:
>Hi Jordi, (and mono devs)
>Mainsoft wish to invest some effort in testing System.Drawing.
>We wish to enhance the test suite with an image compare component which will
>compare the difference between the expected .NET image and the mono image. 
>The comparer (which we just started prototyping it) will be customized and
>produce a result according to several algorithms:
>* Prior to compare: format, size, colors, resolution

If you can wait for a short while, there's a decent chance that a patch
enabling indexed pixel formats will make it into SVN. At the moment,
libgdiplus only does 24- and 32-bit pixel formats (and its 24-bit support
is a hack; the data is stored at 32 bpp anyway, and is converted to/from
24bpp when/if the user calls Bitmap::LockBits/UnlockBits :-).

My patch adds support for 1-, 4- and 8-bpp images, but does not address the
24-bit issue. The 24-bit issue is imposed by Cairo, which works only with
ARGB 32-bpp pixels internally; actually storing the data at 24 bpp would
mean that it would have to be upsampled for pretty much every operation
other than LockBits. It is a trade-off, but I think sacrificing speed in
only one area is better than favouring that area over all others.

Just thought I'd let you know :-)

Jonathan Gilbert

More information about the Mono-devel-list mailing list