www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2012/06/19/12:05:42

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20120113;
h=mime-version:x-originating-ip:in-reply-to:references:from:date
:message-id:subject:to:content-type:x-gm-message-state;
bh=IinmcV5/DboUEH/dtn657nLaFm/l+kGbvMs4oyiNOms=;
b=NuXPOtOq7eo0b1HpFUkN805WIBjWt2FgcHUPrco3MP1VHx3a0MQq0LcVXYLkziLRzP
HasqrPL82BBUqgtCHM8LjCGQsOzNh5PWG8BVG8BFSmrPI+e4y06WwTiyCI2Mpzo9F5Qc
GOqPhgmEQQyifTHo2xd1PfOa6l3jzKtuhsMiLxT6+3wXK4e/oQmO7TmERBSXvZeIhmzX
sQ6OfOGDzHyf/NuHSQPwKnvzqMtlwDceUFSyTsD8CaGKToqvouOAkQC8+8mQhaxL3zgr
p/CP/n4TrsEBbiaSYhc5k44si8vDsmDbX2NTENYcF4NyIpvy7TyOdgzRsjXGxdjNOAo5
kPQQ==
MIME-Version: 1.0
X-Originating-IP: [206.220.194.212]
In-Reply-To: <20120619062206.36f964c4@svelte>
References: <4FE04A04 DOT 6050008 AT gmail DOT com> <20120619062206 DOT 36f964c4 AT svelte>
From: Benjamin Bergman <ben AT benbergman DOT ca>
Date: Tue, 19 Jun 2012 11:04:39 -0500
Message-ID: <CA+DWcQacGPXTqdUo01098R_nkAysPGCXJT4vRQa-VqwDbLOwXw@mail.gmail.com>
Subject: Re: [geda-user] Bitmap/logos in pcb
To: geda-user AT delorie DOT com
X-Gm-Message-State: ALoCoQmWVJ7FACL8gFtZebF1FI6EP1xUNfnYN0o05qrmirIDhMt0sJHzb6Nsyx+o+2sLLv6lqOOf
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--f46d04088c755dc8e904c2d572a5
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Jun 19, 2012 at 8:22 AM, Colin D Bennett <colin AT gibibit DOT com> wrote:

> On Tue, 19 Jun 2012 11:44:36 +0200
> 1tmt <onetmt AT gmail DOT com> wrote:
>
> > Hello all,
> >
> > it's one year now I'm using pcb, and I like a lot the flexibility
> > it allows in modifying at your own will (almost) everything.
> >
> > Now I need to import some bitmaps onto my boards' silk layer; I'm
> > sure it can be done, but have no idea how I can do. Any
> > suggestion would be greatly appreciated.
> >
> > TIA,
> > Carlo
>
> I don't know if anyone has imported a bitmap image into pcb.
> Hopefully someone will speak up if so.
>
> Otherwise, as Levente says, you can use pstoedit to convert vector
> graphics like EPS or PS into .pcb data.  Depending on your specific
> image, you might find the 'potrace' program or using Inkscape's
> 'trace bitmap' feature useful to automatically create a vector
> image from your bitmap.
>
> Regards,
> Colin
>

You can use Inkscape to convert images to .ps files, then us pstoedit.
Inkscape uses potrace as the backend for raster to vector conversion, so if
you want to script it, look into potrace. I think autotrace is another
command line program for raster to vector conversion, and it might even
have .pcb export built in.

Unfortunately, when I did this a while ago I did not keep notes. My goal
was to convert some black and white pixel art to a silk screen. The main
hurdle I had was that my image wasn't a high enough resolution to get the
detail I needed.

For the .ps to .pcb silk screen conversion, I had started writing up some
notes on that for my own use (blindly copied and pasted below):

1) Load your vector image into Inkscape (I will assume that you already
have a vector image and have Inkscape installed)

2) Ensure your image uses only a single colour: black. All black objects
will be added to your pcb object and all empty space will be left empty

3) Convert all objects to paths by selecting each object and using Path ->
Object to path

4) Remove all overlapping vector paths by using Inkscape's merging tools
(union, difference, intersection, exclusion, division, etc) found in the
Paths menu. If you end up with any paths that are touching (or are even
just too close to each other without being joined) you are likely to end up
with gEDA pcb carving gaps between them to meet the specified tolerances.

5) Adjust the file size to be appropriate for the scale it will be on the
board. I have not yet found a way to reliably re-size the imported image
once in pcb, so it is important to get this step right.

6) Save your image as a *.ps (PostScript) file. Make sure the "Convert
texts to paths" box is marked. You may also want to have the "Resolution
for rasterization (dpi)" setting cranked up to its maximum of 10000, but
since the graphic remains a vector through this whole process, I don't
think it will make any difference (I haven't tried playing with that number
yet).

7) From the command line, change to the directory that your *.ps file is in
and run a command like this:

$ pstoedit -psarg "-r1000x1000" -f pcbfill -ssp 'inputfile.ps'
'outputfile.pcb'
When I was first doing this, I didn't add any of the optional parameters
and I was using 'pcb' instead of 'pcbfill'. -f pcbfill helps to ensure that
the objects generated are solid, filled objects, which they might not be
otherwise. -ssp forces things like letters with holes ('o', 'd', 'p', etc.)
to convert correctly. The man page warns that this may be CPU intensive,
but all the conversions I have done have run pretty well instantaneously. I
also found I needed the -psarg "-r1000x1000" to get a good resolution out
of the conversion.

8) Open your new *.pcb file in gEDA pcb and see the results. You may need
to tweak some numbers or add/remove arguments, but so far this seems to
work alright for me. Another option that might allow for a little more
flexibility is including -xscale and -yscale flags if your image isn't
quite the right size. You might also want to move the object into the top
left corner of the pcb layout so that, in case you load it in a layout that
is smaller it will still be visible.

9) At this point, you are ready to load your newly created pcb object into
your full pcb project.

Once you have your image in pcb, you will probably need to move it to the
correct layer. I think you just do this by cutting the image to the buffer
and pasting into a different layer. There might also be a "move selection
to current layer" command.

--f46d04088c755dc8e904c2d572a5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><div>
<br><div class=3D"gmail_quote">On Tue, Jun 19, 2012 at 8:22 AM, Colin D Ben=
nett <span dir=3D"ltr">&lt;<a href=3D"mailto:colin AT gibibit DOT com" target=3D"_=
blank">colin AT gibibit DOT com</a>&gt;</span> wrote:<br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex">


<div><div>On Tue, 19 Jun 2012 11:44:36 +0200<br>
1tmt &lt;<a href=3D"mailto:onetmt AT gmail DOT com" target=3D"_blank">onetmt AT gmail=
.com</a>&gt; wrote:<br>
<br>
&gt; Hello all,<br>
&gt;<br>
&gt; it&#39;s one year now I&#39;m using pcb, and I like a lot the flexibil=
ity<br>
&gt; it allows in modifying at your own will (almost) everything.<br>
&gt;<br>
&gt; Now I need to import some bitmaps onto my boards&#39; silk layer; I&#3=
9;m<br>
&gt; sure it can be done, but have no idea how I can do. Any<br>
&gt; suggestion would be greatly appreciated.<br>
&gt;<br>
&gt; TIA,<br>
&gt; Carlo<br>
<br>
</div></div>I don&#39;t know if anyone has imported a bitmap image into pcb=
.<br>
Hopefully someone will speak up if so.<br>
<br>
Otherwise, as Levente says, you can use pstoedit to convert vector<br>
graphics like EPS or PS into .pcb data. =A0Depending on your specific<br>
image, you might find the &#39;potrace&#39; program or using Inkscape&#39;s=
<br>
&#39;trace bitmap&#39; feature useful to automatically create a vector<br>
image from your bitmap.<br>
<br>
Regards,<br>
Colin<br>
</blockquote></div><br></div><div>You can use Inkscape to convert images to=
 .ps files, then us pstoedit. Inkscape uses potrace as the backend for rast=
er to vector conversion, so if you want to script it, look into potrace. I =
think autotrace is another command line program for raster to vector conver=
sion, and it might even have .pcb export built in.<div>

<br></div><div>Unfortunately, when I did this a while ago I did not keep no=
tes. My goal was to convert some black and white pixel art to a silk screen=
. The main hurdle I had was that my image wasn&#39;t a high enough resoluti=
on to get the detail I needed.</div>

<div><br></div><div>For the .ps to .pcb silk screen conversion, I had start=
ed writing up some notes on that for my own use (blindly copied and pasted =
below):</div><div><br></div><div><div>1) Load your vector image into Inksca=
pe (I will assume that you already have a vector image and have Inkscape in=
stalled)</div>

<div><br></div><div>2) Ensure your image uses only a single colour: black. =
All black objects will be added to your pcb object and all empty space will=
 be left empty</div><div><br></div><div>3) Convert all objects to paths by =
selecting each object and using Path -&gt; Object to path</div>

<div><br></div><div>4) Remove all overlapping vector paths by using Inkscap=
e&#39;s merging tools (union, difference, intersection, exclusion, division=
, etc) found in the Paths menu. If you end up with any paths that are touch=
ing (or are even just too close to each other without being joined) you are=
 likely to end up with gEDA pcb carving gaps between them to meet the speci=
fied tolerances.</div>

<div><br></div><div>5) Adjust the file size to be appropriate for the scale=
 it will be on the board. I have not yet found a way to reliably re-size th=
e imported image once in pcb, so it is important to get this step right.</d=
iv>

<div><br></div><div>6) Save your image as a *.ps (PostScript) file. Make su=
re the &quot;Convert texts to paths&quot; box is marked. You may also want =
to have the &quot;Resolution for rasterization (dpi)&quot; setting cranked =
up to its maximum of 10000, but since the graphic remains a vector through =
this whole process, I don&#39;t think it will make any difference (I haven&=
#39;t tried playing with that number yet).</div>

<div><br></div><div>7) From the command line, change to the directory that =
your *.ps file is in and run a command like this:</div><div><br></div><div>=
$ pstoedit -psarg &quot;-r1000x1000&quot; -f pcbfill -ssp &#39;<a href=3D"h=
ttp://inputfile.ps/" target=3D"_blank">inputfile.ps</a>&#39; &#39;outputfil=
e.pcb&#39;</div>

<div>When I was first doing this, I didn&#39;t add any of the optional para=
meters and I was using &#39;pcb&#39; instead of &#39;pcbfill&#39;. -f pcbfi=
ll helps to ensure that the objects generated are solid, filled objects, wh=
ich they might not be otherwise. -ssp forces things like letters with holes=
 (&#39;o&#39;, &#39;d&#39;, &#39;p&#39;, etc.) to convert correctly. The ma=
n page warns that this may be CPU intensive, but all the conversions I have=
 done have run pretty well instantaneously. I also found I needed the -psar=
g &quot;-r1000x1000&quot; to get a good resolution out of the conversion.</=
div>

<div><br></div><div>8) Open your new *.pcb file in gEDA pcb and see the res=
ults. You may need to tweak some numbers or add/remove arguments, but so fa=
r this seems to work alright for me. Another option that might allow for a =
little more flexibility is including -xscale and -yscale flags if your imag=
e isn&#39;t quite the right size. You might also want to move the object in=
to the top left corner of the pcb layout so that, in case you load it in a =
layout that is smaller it will still be visible.</div>

<div><br></div><div>9) At this point, you are ready to load your newly crea=
ted pcb object into your full pcb project.</div><div><br></div><div>Once yo=
u have your image in pcb, you will probably need to move it to the correct =
layer. I think you just do this by cutting the image to the buffer and past=
ing into a different layer. There might also be a &quot;move selection to c=
urrent layer&quot; command.</div>

</div></div>

--f46d04088c755dc8e904c2d572a5--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019