Important alert: (current site time 7/16/2013 2:14:56 AM EDT)
 

winzip icon

A Real Inpainter (Faster Version)

Email
Submitted on: 1/13/2009 1:39:11 PM
By: Scythe 
Level: Advanced
User Rating: By 28 Users
Compatibility: VB 5.0, VB 6.0
Views: 12332
author picture
 
     One of the most advanced routines in picture editing. Remove undesirable parts from pictures. With this routine the picture looks like the removed part was never there like you can see on the screenshot. Please leave comments and if you like it then vote :-) Update: Fixed some errors and updated the gui

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 23 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

1/2/2009 5:01:34 AMErkan Sanli

Good work.But for same picture.
(If this comment was disrespectful, please report it.)

 
1/2/2009 6:35:23 AMScythe

I found 2 Bugs and will them fix in the next update.
Change these 2 lines In Function DoInPaint
m_width = UBound(PicAr1, 1) + 1
m_height = UBound(PicAr1, 2) + 1

In Project Properties / Compile / Advanced
Disable Remove Array Bounds Checks
If not the programm will crash if you inpaint near the borders of the picture

(If this comment was disrespectful, please report it.)

 
1/2/2009 1:54:52 PMMark

Great work! Very original - thanks for sharing - 5 removable balls!
(If this comment was disrespectful, please report it.)

 
1/3/2009 5:38:12 AM

cool
(If this comment was disrespectful, please report it.)

 
1/3/2009 8:46:56 AMSiavash

It was a real real inpaiter! Giant work!
(If this comment was disrespectful, please report it.)

 
1/5/2009 12:46:50 AMBen Ng

Great work. Very professional.
(If this comment was disrespectful, please report it.)

 
1/6/2009 11:38:44 AMxpert

AWESOME !!!
5 globes
(If this comment was disrespectful, please report it.)

 
1/7/2009 1:11:05 AMQuicksilver

Excellent - very effective
(If this comment was disrespectful, please report it.)

 
1/7/2009 2:52:49 AMQuicksilver

did a thorough search and this is the best implementation i have seen. there are a few shareware and freeware programs but they dont do it as cleanly as done by you, Scythe. simply superb.
(If this comment was disrespectful, please report it.)

 
1/7/2009 6:19:50 AMQuicksilver

it is now the whole day that i have been playing around with your excellent program and i am facinated by it. you have very graciously provided the code thank you but if you could point me to some theory behind the working i would be very grateful.
(If this comment was disrespectful, please report it.)

 
1/7/2009 6:50:07 AMThePiper

Very good; compliments! You can improve the performance dramatically if you avoid countless (senseless)
repetitive calculations of the same things. Tipp: Work with static Module-Variables and Calc the Indices ONCE before their multiple use.

'Example PatchTexture (Extract)
Dim mTidx As Long, mSidx As Long
'-------
If target_x > 0 And target_x < m_width And target_y > 0 And target_y < m_height Then
Tidx = target_y * m_width + target_x
Sidx = source_y * m_width + source_x
If m_mark(Tidx) >= 0 Then
temp_r = m_r(Tidx) - m_r(Sidx)
temp_g = m_g(Tidx) - m_g(Sidx)
temp_b = m_b(Tidx) - m_b(Sidx)
sum = sum + temp_r * temp_r + temp_g * temp_g + temp_b * temp_b
End If
End If

So we can save millions of calculations and microseconds... :)
(If this comment was disrespectful, please report it.)

 
1/10/2009 5:59:58 AMScythe

Quicksilver: There are so many Papers (most are not good :-)in the www Try it with this Pages www.cc.gatech.edu/~sooraj/inpainting/

ThePiper: Why didnt i Think about this ? Thanks i will do this.
(If this comment was disrespectful, please report it.)

 
1/13/2009 3:34:33 PMBill K of Boston

ultra nice code ...
(If this comment was disrespectful, please report it.)

 
1/14/2009 4:32:52 AMMil-X Pro

If I'm not overlook, this is the only code in PSC demonstrate such technique. 5*****
(If this comment was disrespectful, please report it.)

 
1/17/2009 4:11:54 PMjasonh

Whatever you did from the previous version to this version, you made it worse, now when I use it the images look real ugly. Sticking with previous version since this version is really screwed up.
(If this comment was disrespectful, please report it.)

 
1/19/2009 12:33:43 PMScythe

I tested the new version and cant find any errors.
Anybody else here who has the same Problems like jasonh ?

(If this comment was disrespectful, please report it.)

 
1/27/2009 4:26:46 PMSpector

Not sure what "jasonh" is talking about, works great on my end. Thanks a lot for sharing, I've never seen anything like this done in VB before.
(If this comment was disrespectful, please report it.)

 
1/25/2011 6:03:00 AMRoss

This is aresome, thanks so much!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.