Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi,
i have two images and i need to compare them then i need to get all pixels of first image which are not same in second image.
e.g.
if half of image 1 is same as image 2 so i want the half of image 1 which is different from image 2.
Posted
Updated 7-Jun-14 16:55pm
v2
Comments
Dave Kreskowiak 7-Jun-14 16:59pm    
Permission granted! Please, proceed.

Or did you forget to ask a question?
ZurdoDev 7-Jun-14 21:48pm    
You'll need to search for a 3rd party control to do that. I do not believe .Net can do that built-in.
gggustafson 7-Jun-14 22:14pm    
Are the images the same size? Are they color or B/W?
Sergey Alexandrovich Kryukov 7-Jun-14 22:47pm    
Did you notice that your problem is not fully defined. You did not define what to do with matching pixels and different pixels.
—SA

1 solution

Please see my comment to the question.

One of the way to perform necessary calculations is using System.Drawing, more exactly:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits.aspx[^].

There are some code samples on the pages of each of these methods, just to understand how to use them. Most important thing here is not to use GetPixel/SetPixel as those method would work prohibitively slowly for your purpose.

—SA
 
Share this answer
 
Comments
Mohammed Nabeel Khan 9-Jun-14 15:47pm    
thanx Sergey Alexandrovich but i need to do it faster. i know i can do it with bitmapData class much faster but how to get the difference ? should i compare every pixel? isn't there any bitwise operation i can do with bytes like And or Nand?
Mohammed Nabeel Khan 9-Jun-14 15:58pm    
Sir is there you peoples culture to degrade other people?
this is my third question and God knows that except for demotivating me, you your friends have not helped me.
With respect sir, i might not be a good programmer but i put my best efforts in it.
Well thanks for your demotivation, Sergey Alexandrovich.
M Nabeel Khan

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900