Click here to Skip to main content
11,496,146 members (782 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: C# graphics
Hi,

I want to remove the changes done to my image by others and get back the original image. I can do a comparison of original and modified image. But what if I have a single image that has been modified by others, is there any way to remove such a change? I need it soon... can any body tell me how to do it. Thank you.
Posted 14-May-10 22:11pm
Edited 14-May-10 23:25pm
Moak11.4K
v3
Needing it "soon" doesn't affect our willingness to help you because urgency on your part doesn't imply an emergency on our part.

You're going to have to setup some sort of "undo" feature so you can undo changes in the reverse order that they occurred. The brute force approach is to maintain a copy of the image after each change. Since some images can be rather huge, you'll probably have to limit the number of undo's that the user can - ummm - do.

I suppose you could xor the image so that only the pixels that changed are kept in the undo buffer, and then you can simply reverse that process to regain the previous image iteration.

You can also maintain a layer buffer that only has the changes that were made in each layer. when the user wants to undo, simply delete the newest layer from the list. When the user saves the image, merge the layers, and then save.

Unfortunately, this is not a trivial task where images are concerned, and you'll have to come up with the code yourself. On the bright side, you'll be 1 step closer to being able to call yourself a programmer, and you can post an article here describing how you accomplished your task.
  Permalink  
v3
Last time you were modifying image byte array...

Now you want modified image back. If you tracked the changes then 'yes' you can get that, or else no way to get the original back.
  Permalink  
I realise that you are new to this site and so might not be familiar with its customs.

It is considered rude to post the same question in more than one place, please stop doing it!

If you are unsure about what is and what is not acceptable read the posting guidelines. CodeProject Forum Guidelines[^].
  Permalink  

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

  Print Answers RSS
0 Dnyaneshwar@Pune 692
1 RyanDev 230
2 CHill60 163
3 Sascha Lefèvre 145
4 Sergey Alexandrovich Kryukov 124
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 15 May 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100