I've tried to build something similar with the ImageMagick API, but I've had many troubles compiling a DLL from the libraries.
I am also unfamiliar with the .net libraries, but I've been reading up on MSDN.
I know how the basic flow of the program should go (I think), I've been having trouble executing the steps.
Load ImageA
Load ImageB
Take the difference (absolute value of the difference in color between the images)
Change Channels of this new image (give color to the masking)
Save this as a different image. (Temporarily: To be used as a mask later.)
Change the channels of this image (To give it color)
Overlap the image with the mask on top
Save the image.
Here is what I have so far.
//Load ImageA
Image ImageA = new Image.From("ImageA.jpg");//Load ImageB (Assume same size)
Image ImageB = new Image.From("ImageB.jpg");//Take the difference of the images: If there is a visible difference, display some white, otherwise show black.
//How would I do this for colored images?//Save this image. (Temporarily [should I turn this into a BLOB?])
ImgTmp = Bitmap("[????].jpg");//Change Channels of this new image (This section of the code is taken/modified (badly) from <http://www.codeproject.com/KB/GDI-plus/csharpgraphicfilters11.aspx>. I admit now that I don't know what I'm doing.)
unsafe
{
byte * p = (byte *)(void *)Scan0;}
int nOffset = stride - b.Width*3;
byte red, green, blue;
for(int y=0;y < b.Height;++y)
{for(int x=0; x < b.Width; ++x )}
{}
blue = p[0];
green = p[1];
red = p[2];
p[0] = p[1] = p[2] = (byte)(1 * red
+ 0 * green
+ 0 * blue);
p += 3;
p += nOffset;
//Overlap the image, onto ImageB.
//(Don't know how to do this in the way I want)
//Save Resulting Image.
Final.Save("[Filepath]\Final.jpg", System.Drawing.Imaging.ImageFormat.jpg);----------------------------------
Please correct me if anything (read: EVERYTHING) is wrong, or a location of a properly functioning Magicknet DLL.
Again, I am learning, so I could use a lot of help on this.
Thanks!