Author |
Message |
electrospeaker
Joined: Jun 30, 2006 Posts: 49 Location: Norway
|
Posted: Wed Feb 19, 2014 4:13 pm Post subject:
How to best retouch scanned PCB artwork? |
|
|
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
|
|
|
DUBmatze
Joined: Feb 18, 2013 Posts: 150 Location: south Germaica (schwabilon)
|
Posted: Thu Feb 20, 2014 12:09 am Post subject:
|
|
|
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. |
|
Back to top
|
|
|
electrospeaker
Joined: Jun 30, 2006 Posts: 49 Location: Norway
|
Posted: Fri Feb 21, 2014 3:23 am Post subject:
|
|
|
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
I'm open for suggestions on how to make the process easier/better
Description: |
|
Filesize: |
143.68 KB |
Viewed: |
3763 Time(s) |
|
Last edited by electrospeaker on Sat Feb 22, 2014 8:39 am; edited 2 times in total |
|
Back to top
|
|
|
electrospeaker
Joined: Jun 30, 2006 Posts: 49 Location: Norway
|
Posted: Sat Feb 22, 2014 6:21 am Post subject:
|
|
|
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
Description: |
|
Filesize: |
153.5 KB |
Viewed: |
3640 Time(s) |
|
Description: |
|
Filesize: |
103.81 KB |
Viewed: |
3626 Time(s) |
|
|
|
Back to top
|
|
|
-minus-
Joined: Oct 26, 2008 Posts: 787
Audio files: 13
|
Posted: Sun Feb 23, 2014 8:05 am Post subject:
|
|
|
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
|
|
|
electrospeaker
Joined: Jun 30, 2006 Posts: 49 Location: Norway
|
Posted: Sun Feb 23, 2014 12:18 pm Post subject:
|
|
|
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
|
|
|
shawn
Joined: Dec 13, 2005 Posts: 209 Location: savannah
|
Posted: Tue Feb 25, 2014 11:27 pm Post subject:
|
|
|
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
|
|
|
electrospeaker
Joined: Jun 30, 2006 Posts: 49 Location: Norway
|
Posted: Thu Feb 27, 2014 2:19 pm Post subject:
|
|
|
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
|
|
|
|