collapse

* Recent Topics

HELP! Missing parts by schen
[Today at 09:35:16 PM]


PS 22 upgrade by schen
[October 23, 2020, 03:17:28 PM]


Using Your Smart Phone to Scan a Photo by Mhayes
[October 17, 2020, 09:10:29 PM]


Have Patience as More Photos Coming by Kerbstone
[October 08, 2020, 02:47:52 PM]


Happy Birthday Shujen by schen
[October 01, 2020, 11:29:43 PM]


??? by Lynnya
[September 29, 2020, 12:34:29 PM]


Hi, I'm T! by Lynnya
[September 29, 2020, 12:33:32 PM]


color advice unrelated to opr by Kerbstone
[September 09, 2020, 03:40:17 AM]


Happy Birthday Jonas by Jonas.Wendorf
[August 19, 2020, 05:32:05 PM]


School Days School Days by Candice
[August 16, 2020, 12:47:08 PM]

Author Topic: Removing White Dots  (Read 28438 times)

rockthumper

  • Guest
Removing White Dots
« on: September 14, 2007, 07:39:40 AM »
After working on my first restoration photo, which was covered in white dots, I was sure there was a better way to deal with or at least reduce the problem to automatically bring the photo to a reasonable state for manual finishing. I recorded some actions as a 'script' in Paint Shop Pro X which is the photo manipulation software I use and was pleasantly surprised by the results. The success of my early efforts was very dependent on the brightness of the background and completely ignored non-white blemishes - black dots, for example. Recent changes I've made to the way the script detects the dots means that it now works on light or dark dots, and also reduces small scratches and blotches. Here is an example of the kind of damage I was dealing with:



The script is currently in it's third version and is called WD3. This can be applied to the whole photograph or, I think with better results, to a selection. The script can run completely automatically. For best results it can also be run manually and the parameters fine tuned to get the best fit to the image. You can run it several times over the same area of the image with some improvement.
Here is the result of running WD3 through two iterations - firstly in auto on the larger selection and then manually on the smaller one. The square selections I made are indicated by the taped corners:



All that was required was to make a selection and run the script. Personally I think it looks pretty good. It works on either colour or b&w images.
I haven't done photo restoration before so I don't know all the tools that are available. I'm sure there are better ones out there but I thought the results were worth a post here. If any member of OPR  would like to use my script as a tool to help them with their restorations I'll send you a copy. For the Photoshop people I can just tell you what the script does and you can write your own action(?) - there's actually nothing very complicated going on.
RT.

Offline Hannie

  • Site Admin
  • OPR Master
  • *****
  • Posts: 4758
Re: Removing White Dots
« Reply #1 on: September 14, 2007, 08:04:01 AM »
Wow, you really made those white spots disappear completely, very good job!
The only reservation I have is that there are now some fuzzy edges that weren't there before.
(I know, I'm being a real crab-apple now!  :P)

Hannie
Hannie Scheltema
Distribution Coordinator
hannie@operationphotorescue.org

Offline glennab

  • OPR Master
  • *****
  • Posts: 3226
Re: Removing White Dots
« Reply #2 on: September 14, 2007, 08:50:22 AM »
Hi RT

I love the functionality of your script.  What a time-saver!  Since I'm using Photoshop, I'd appreciate an explanation of what your script does, so I can try to replicate it.  Anything that eliminates the kind of grunt work involved in cleaning up the type of debris you have in your restoration will allow us to be much more productive on the worst areas.

My compliments on your tenacity and savvy!

Glenna

P.S.  Ms. Crab Apple -- picky, picky, picky!  I don't know about you, but I'd rather deal with smoothing some fuzzy edges than eliminating five gazillion small dots one by one.  Been there; done that; have a t-shirt!
« Last Edit: September 14, 2007, 08:53:21 AM by glennab »
What we do for ourselves dies with us. What we do for others and the world remains and is immortal. ~Albert Pine

(Photoshop CS5 /Mac Pro)

Offline phischer

  • OPR Long Time Hero
  • ***
  • Posts: 106
Re: Removing White Dots
« Reply #3 on: September 14, 2007, 09:05:37 AM »
Hmm looks pretty good. What's your secret for us Photoshop users?

Offline sanbie

  • OPR Resident Expert
  • ****
  • Posts: 379
Re: Removing White Dots
« Reply #4 on: September 14, 2007, 09:13:24 AM »
Oooh thank you for the offer RT..I would love to have it please..anything that helps with those ghastly white dots has to be a bonus!!

Sanbie
paintshop pro X1

Offline Hannie

  • Site Admin
  • OPR Master
  • *****
  • Posts: 4758
Re: Removing White Dots
« Reply #5 on: September 14, 2007, 01:14:07 PM »
You are absolutely right Glenna!  Who worries about fuzzy arms, certainly not when restoring a portrait of an orangutan!
Just kidding, I think RT did an amazing job writing that script.  It will be very helpful to many of us!

P.P.P. Crabapple
« Last Edit: September 14, 2007, 01:17:39 PM by Hannie »
Hannie Scheltema
Distribution Coordinator
hannie@operationphotorescue.org

Offline Ratz

  • OPR Resident Expert
  • ****
  • Posts: 467
Re: Removing White Dots
« Reply #6 on: September 14, 2007, 02:44:17 PM »
great job RT! what a time saver,very close to the "poofer" tool we used to joke about :up:

Offline Tess (Tassie D)

  • Site Admin
  • OPR Master
  • *****
  • Posts: 2057
    • Travels around the country.
Re: Removing White Dots
« Reply #7 on: September 14, 2007, 06:26:49 PM »
Great job RT. :up: Puts hand up for script.
Tess Cameron
Distribution Coordinator
tcameron@operationphotorescue.org

klassylady25

  • Guest
Re: Removing White Dots
« Reply #8 on: September 14, 2007, 08:20:18 PM »
Won't be much help if ya don't know what he's talking about!  lol

rockthumper

  • Guest
Re: Removing White Dots
« Reply #9 on: September 14, 2007, 08:24:42 PM »
No worries, I'll be happy to answer what I can.  :)

Sanbie and Tassie D - I'm going to upload the script in text file format to an online file host. But there may be a delay while I work that out. Alternatively if you're happy to send me your email address I'll email it to you.

Hannie - You are quite right, the script does introduce imperfections - it blurs edges and it introduces a white 'fog' visible on dark areas, particularly when the white dots get very dense. That's partly why I think it works better on selections rather than on the whole image - you can avoid boundaries for one thing to avoid the edge problem. You may decide it causes more damage than it's worth but I've got to say, on the few examples I've tried it, the results look good to me!

The basic idea is replace a white dot with a slightly larger dot of similar colour to it's surroundings. Here are the details of what the script should do:

Make a selection in the original damaged image.
Copy the selection and 'paste as a new image' three times.
The copies will be named "image#1","image#2" etc but I will refer to them by usage. Leave the original to one side but do not close the selection.

Copy 1 - "Tones"
Apply the Salt & Pepper filter
  Set Speck size=15 sensitivity=7
  Include lower speck sizes, aggressive action.
Copy this image.

Copy 2- "Mask"
Sharpen More
Paste as a new layer ( this pastes in a copy of Tones).
Set blend mode to difference.
Add a Levels Adjustment layer to maximise contrast between the background and the dots.
Merge Visible then use Dilate (Effects > Edge Effects > Dilate). 

Copy 3 - "Fix"
Copy and paste Tones as a new layer.
Add a new layer mask 'from image' and select the number of the image used for Mask.
Merge visible.
Copy this image and close all the images except the original.

Original Image
Make a new Raster layer, call it "Repair" for example.
Paste into selection.
Select none and save.

The original selection should now have the white dots replaced by areas of colour which closely match their surroundings. The new Repair layer can be edited to improve the match or if unsatisfactory can be discarded leaving the original untouched.


If anyone has a suggestion for a better way of making the Tones copy (or anything else) please let me know.
RT

klassylady25

  • Guest
Re: Removing White Dots
« Reply #10 on: September 14, 2007, 08:33:03 PM »
Thanks.  Now will need to translate it into Photoshop, but I can work on that.  There are some similarity of terms.

 :hug: Candy

rockthumper

  • Guest
Re: Removing White Dots
« Reply #11 on: September 14, 2007, 09:18:58 PM »
Candy - good luck, let me know how it goes.

For the PaintShop Pro people - a text version of the script can be downloaded from here:
WD3Auto.txt

- save the file as a PspScript in the 'My Documants\My PSP Files\Scripts-Trusted' folder. It needs to run as a trusted script because it deletes copies of images as it runs.
For those not familiar with using scripts turn on the Script Toolbar in PSP by clicking View > Toolbars > Script. You should now have a toolbar where you can select WD3Auto from a pulldown menu, open (a copy of) your restoration original, make a selection and then press the Play button in the toolbar to run the scipt. :D

Cheers,
RT.

Edit: The PspScript version is now here: http://www.keepmyfile.com/download/ba04111883239 so you don't have to cut and paste the text file.
« Last Edit: September 17, 2007, 08:40:31 PM by rockthumper »

Offline Tess (Tassie D)

  • Site Admin
  • OPR Master
  • *****
  • Posts: 2057
    • Travels around the country.
Re: Removing White Dots
« Reply #12 on: September 14, 2007, 09:58:06 PM »
:up: Thanks RT, got it. Will try it out after lunch.
Tess Cameron
Distribution Coordinator
tcameron@operationphotorescue.org

Online schen

  • Site Admin
  • OPR Master
  • *****
  • Posts: 980
Re: Removing White Dots
« Reply #13 on: September 15, 2007, 04:31:37 PM »
I asked for one that I thought would be easy:



After the high-res download, I see the picture is covered with white dots all over.  Since they are not evenly distributed, FFT filter did not yield much.



These white dots seem to be the artifact of copy lighting on the textured paper.  The problem appeared to be common in this copy run.

I would like to do some research on white dot reduction techniques during the copy process.  Could someone send me a picture of the copy stand and lighting arrangement for me to duplicate the process?
Windows 10, Photoshop CS6

Offline sanbie

  • OPR Resident Expert
  • ****
  • Posts: 379
Re: Removing White Dots
« Reply #14 on: September 15, 2007, 07:29:46 PM »
Candy - good luck, let me know how it goes.

For the PaintShop Pro people - a text version of the script can be downloaded from here:
WD3Auto.txt

- save the file as a PspScript in the 'My Documants\My PSP Files\Scripts-Trusted' folder. It needs to run as a trusted script because it deletes copies of images as it runs.
For those not familiar with using scripts turn on the Script Toolbar in PSP by clicking View > Toolbars > Script. You should now have a toolbar where you can select WD3Auto from a pulldown menu, open (a copy of) your restoration original, make a selection and then press the Play button in the toolbar to run the scipt. :D

Cheers,
RT.

That will teach me not to read all the way down first wont it..Lol..Just ignore my email RT I have now downloaded it! Thank you so much for sharing this...

Sanbie
paintshop pro X1