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 Date: Tue, 19 Jun 2012 11:04:39 -0500 Message-ID: Subject: Re: [geda-user] Bitmap/logos in pcb To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary=f46d04088c755dc8e904c2d572a5 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 Precedence: bulk --f46d04088c755dc8e904c2d572a5 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jun 19, 2012 at 8:22 AM, Colin D Bennett wrote: > On Tue, 19 Jun 2012 11:44:36 +0200 > 1tmt 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

On Tue, Jun 19, 2012 at 8:22 AM, Colin D Ben= nett <colin AT gibibit DOT com> wrote:
On Tue, 19 Jun 2012 11:44:36 +0200
1tmt <onetmt AT gmail= .com> wrote:

> Hello all,
>
> it's one year now I'm using pcb, and I like a lot the flexibil= ity
> it allows in modifying at your own will (almost) everything.
>
> Now I need to import some bitmaps onto my boards' silk layer; I= 9;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. =A0Depending 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 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.

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't a high enough resoluti= on to get the detail I needed.

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):

1) Load your vector image into Inksca= pe (I will assume that you already have a vector image and have Inkscape in= stalled)

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 Inkscap= e'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.

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.

6) Save your image as a *.ps (PostScript) file. Make su= re 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&= #39;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' 'outputfil= e.pcb'
When I was first doing this, I didn't add any of the optional para= meters and I was using 'pcb' instead of 'pcbfill'. -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= ('o', 'd', 'p', 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 "-r1000x1000" to get a good resolution out of the conversion.

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'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.

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

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 "move selection to c= urrent layer" command.
--f46d04088c755dc8e904c2d572a5--