[Image-SIG] removing dots

Jeff Epler jepler at unpythonic.net
Thu Jul 21 20:03:16 CEST 2005

Assuming you can write a loop that "visits" each dot (not hard if
they're evenly spaced and the upper-leftmost dot is fixed in position,
but harder if that's not true), here's the kind of heuristic I'd try
using at each dot:

    For each row and column, count how "open" it is.  For each white
    pixel above or below a column, or each pixel left or right of a row,
    it gets one additional "open" count.  These counts range from 0 to

    A pixel's "open" count is the sum of its row open count and its
    column open count.  The counts range from 0 to 4.

    A pixel is removable if it is "3-open" or "4-open".

I think this will do the right thing when a dot impacts a vertical or
horizontal trace, but I'm less confident in the case that it impacts a
diagonal trace or a pad.

I don't know what software generates these files you have, but here's
another idea:  if you can change the grid pitch, generate several images
with different pitches, then the pixels you want to turn white are the
ones that are white in one of the different pictures.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.python.org/pipermail/image-sig/attachments/20050721/8f79fda0/attachment.pgp

More information about the Image-SIG mailing list