electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
<on air> Rob Adventures in Sound
Please visit the chat
 Forum index » DIY Hardware and Software
How to best retouch scanned PCB artwork?
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
electrospeaker



Joined: Jun 30, 2006
Posts: 15

PostPosted: Wed Feb 19, 2014 4:13 pm    Post subject: How to best retouch scanned PCB artwork? Reply with quote  Mark this post and the followings unread

I'd like to scan and print some PCB artwork taken from an electronics DIY magazine project but am at loss how to retouch this for the best possible result (removing tiny dots, blobs etc. and smoothing out jagged PCB traces and so on). The original designs are probably hand drawn as they're from around 1980 and thus not as perfect as done nowadays with CAD software (Eagle etc.).

Using Adobe Photoshop I've tried various methods after scanning the artwork at a pretty high resolution (my latest attempts being at 1200 ppi but I assume 300 ppi will do), but they all seem pretty ineffective and very time consuming.
I believe I also read somewhere about people tracing the circuits and converting them into vector graphic using Adobe Illustrator, but this sounds unnecessarily complicated as a printed bitmap image (at a high resolution) will likely be as good as a vector image?

Any advice for a quick and effective procedure for touching up a few simple PCBs would be highly appreciated!
Back to top
View user's profile Send private message
DUBmatze



Joined: Feb 18, 2013
Posts: 74
Location: DE

PostPosted: Thu Feb 20, 2014 12:09 am    Post subject: Reply with quote  Mark this post and the followings unread

if you can use the Vector tools, inkscape wud be great for that (open source)
just open the scan in inkscape. Run a "make vectors batch" and you can edit it.

_________________
http://matze.reggaestriert.de/diy-projekte/
Back to top
View user's profile Send private message Visit poster's website
electrospeaker



Joined: Jun 30, 2006
Posts: 15

PostPosted: Fri Feb 21, 2014 3:23 am    Post subject: Reply with quote  Mark this post and the followings unread

I already have Illustrator which I believe would do the same thing, but is there really a need for converting the bitmap image into vector art? That wouldn't make for less cleaning up, would it?

I'm probably answering my own question here as I've been experimenting with Photoshop and found one way to get a satisfactory result. Feel free to post comments on this. Here's what I've done:

1) first, scan the PCB artwork from the magazine at 1200 ppi (perhaps 300 will do, but you can always resample it down later). TIFF as the file format for lossless quality. I chose color mode because I will be working with a color layer later in Photoshop.

2) Open the scanned document in Photoshop. Copy the layer to a new a new layer, then disable the "background" layer (we won't be messing with the original document in case we make a mistake)

3) As a tool to aid inspection later, create a new layer and place it below the "background copy" layer.
Choose a very bright foreground color (magenta, light green etc.) which you fill the entire layer with (ALT backspace).

4) Create a "Brightness/contrast" adjustment layer and move it to the very top. In my case I set the brightness to +4 and the contrast to +100. Experiment with your settings until the background becomes as clean and paper white as possible as it'll make cleaning up later a lot easier.

5) Select the "Background copy" layer again.
Now choose the "Magic Wand" tool which is set to:
- "New layer" mode
- "Anti alias" on
- "Contiguous" off (so the component holes will also be included in the selection)

You will need to experiment with the "Tolerance" value. Lower values selects more which means more cleaning up while higher numbers selects less, so take care that it won't leave out some of the PCB artwork!
With the Magic wand tool on, click somewhere in the background (in the white area, outside the PCB artwork) and all the PCB traces and other artwork should end up with "marching ants" all around them. You'll likely also have selected some dirt or dust, but don't worry about that now.
If the selection looks good press BACKSPACE to remove everything which isn't selected. The background should now become the bright color we chose the bottom-most layer to be.

6) next we come to cleaning up all the dots, dirt and other unwanted artifacts in the background. Because of the bright background color they might be easier to see than with a white background.
Ensure you're in the "Background copy" layer, then choose the "Eraser" tool (E) and erase all the dots you see.
Some dots can be very hard to see so in those cases you can use the "Magic wand" (W), click on the background again, choose the "Marquee" (M) tool (I prefer the rectangular one), then hold down SHIFT (which will show a small + next to the mouse-pointer) while drawing a rectangle around an area with dots you want to remove. Press BACKSPACE to actually remove them, then repeat for dots in other places.

You may also need to fix broken parts of the PCB traces.
First reset to the default background/foreground colors by pressing D. This should give you black as the foreground color. Now select the brush (B) tool. For this work I would set the hardness to 100%. Just right-click to get to these options. To quickly change the size of the brush you can hold down CTRL, ALT and the mouse button, then move the mouse from left to right and see the brush size change.
Now paint black over the damaged traces. If you make a mistake use the eraser (E).
By the way, to deselect the magic wand selection you just press CMD-D (CTRL-D on a PC).

7) When everything is touched up the way we want it we might want to darken the artwork as much as possible (so as to block the UV-light when doing the developing).
Still in the "Background copy" layer, choose the "Magic wand" tool (W) and click on the background to select the entire PCB artwork.
Invert the section (SHIFT-CMD-I, or SHIFT-CTRL-I on a PC) so as to select the PCB artwork itself.
Next, create a new layer which should appear above the "Background copy" layer. This will be where we actually fill in the black color. Let's name it "black overlay".
Now we want to fill in the selected areas with black, so ensure you have the default colors (D) where black should be the foreground color.
Click on the new layer ("Black overlay) to select it, then press ALT-BACKSPACE which should fill in the entire artwork with a deep black color.
To see the difference, first deselect the Magic wand selection by pressing CMD-D (CTRL-D on a PC), then turn off/on the "Black overlay" layer by clicking on the eye next to it. You should see a clear difference.

That's it! Before printing ensure that the bottom layer with the bright background color is turned off! Depending on your results you may also want to sharpen the artwork (Filter-Sharpen-Unsharp mask) or smooth out jagged edges by once again selecting the PCB artwork using the Magic wand (W), then using "Refine edge" (Select-Refine edge). Use the preview and adjust the control until you get the results you want.
Remember, it's the "Black overlay" layer which is the fully edited and cleaned up layer we want to use for printing. As a final check to ensure that everything is 100% OK, only turn on the "Black overlay" layer and a background color layer (obviously not black but white or another bright color) and do a visual check of the whole PCB, preferrably magnified. There is a slight chance that something needs to be retouched at this stage as well.

To make the process easier for my next PCB scan I created a Photoshop action which sets up all the layers, background color and adjustment layer. There's still a lot of retouching involved but I guess that's just the way it is Wink

I'm open for suggestions on how to make the process easier/better Very Happy


pcb_edit.png
 Description:
 Filesize:  143.68 KB
 Viewed:  1013 Time(s)

pcb_edit.png



Last edited by electrospeaker on Sat Feb 22, 2014 8:39 am; edited 2 times in total
Back to top
View user's profile Send private message
electrospeaker



Joined: Jun 30, 2006
Posts: 15

PostPosted: Sat Feb 22, 2014 6:21 am    Post subject: Reply with quote  Mark this post and the followings unread

PS: I found that a black background will sometimes be more useful as an aid for visually detecting small specs of dust, dirt etc. instead of a brightly colored background. Actually switching between the two might be the best way to find all those dots. Your mileage may vary Wink


black_all.png
 Description:
 Filesize:  153.5 KB
 Viewed:  891 Time(s)

black_all.png



dust.png
 Description:
 Filesize:  103.81 KB
 Viewed:  877 Time(s)

dust.png


Back to top
View user's profile Send private message
-minus-



Joined: Oct 26, 2008
Posts: 750

Audio files: 13

PostPosted: Sun Feb 23, 2014 8:05 am    Post subject: Reply with quote  Mark this post and the followings unread

I really think you would be best off redrawing this in Illustrator. Use the pen tool to draw the line work. Draw solder pads with the ellipse tool and rounded rectangle and copy and paste. It shouldn't take more than a couple of hours to have a perfect vector trace of this.
Back to top
View user's profile Send private message
electrospeaker



Joined: Jun 30, 2006
Posts: 15

PostPosted: Sun Feb 23, 2014 12:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Although I do have Illustrator I'm not very familiar with it -I'm mostly a Photoshop user, and it has the pen tool as well. Alas I haven't used it much and thus don't work very quickly with that tool.

But since I've already scanned and cleaned up almost all of the PCBs so the "Magic wand" tool works fine to select the PCB traces, couldn't I just convert that into vector shapes instead of redrawing all the PCB shapes manually?

Silly question perhaps: but why should I convert the high resolution bitmap into a vector image? I thought printing something at a lower resolution than the original image wouldn't cause any problems, only if you try to print a low resolution image into something higher.

Are there any "how to" guides concerning the subject of PCB scans/editing/printing with Photoshop other than the stuff I've already figured out myself in this thread?
Back to top
View user's profile Send private message
shawn



Joined: Dec 13, 2005
Posts: 209
Location: savannah

PostPosted: Tue Feb 25, 2014 11:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

One way that I have done a scanned image from a magazine is convert it to an 8bit BMP then import it into eagle. Then I just trace it. Works really well.
Back to top
View user's profile Send private message
electrospeaker



Joined: Jun 30, 2006
Posts: 15

PostPosted: Thu Feb 27, 2014 2:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

Impressive! After some trial and error I managed to import the BMP image into either the schematic or PCB window.
So by tracing, do you mean that you "place" all the components on top of the BMP image, then join them together using the BMP image's PCB traces as guidelines?

That would be really cool, but being an Eagle novice I as yet haven't found a way to start building a board and then turning it into a schematic, only the other way round. Is this possible?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar, Scott Stites, Uncle Krunkus
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
mps board

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use