X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696209766; x=1696814566; darn=delorie.com; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=cWfYvRAyTklzda69ZMO6yDXmg3gI+Y+QTqb6kxBDPVA=; b=dMR+DO4Anmff4mcpYTyC8FthdaQw3jcFiBZgOb1TiZws05DC6tO7ovQSesL2j/JIux 95NVYcTmLHfFOkIziU/1Qxmt8jjAOoviIcThRVFKIFPQ4zSy7JgydqIjRTVEu8FVMX9R 1OmAiEmk7puLEsw9b1EljF/OM3/JfKYc6BEaau0kwfiHOEzAPxbAo29wkxzII17DXLn8 SAVc1lm0oZvzpoMxK5mxDh7EjTEo2T08Cj54C/ALGz7kEZ7bsRSVY5fF/DU9RRaVCVeL BRQZO+zhvh1dJmaSEe9ozJudt9dvTPwDFbuxqrETRj7hUP3dG8xcUhxa28VAHmxocoDQ KzAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696209766; x=1696814566; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cWfYvRAyTklzda69ZMO6yDXmg3gI+Y+QTqb6kxBDPVA=; b=BmQxSKvQTa+nThtpmCcJeGt+3G1cxaA2tN9XM47Bjwi2WMhypoJN27tL57NCQvtqJO qIQ3ji7TQD2Vmz67pEpwZzGt/Oc2q8ssj3HNhRT0pbfIlB5mFRItvShRofvWxxNSHh5Q RwVxOlsPb4NsKDdjRDkeND3WxlXA0b1TtLyujtBhbReYnUZPZpLJIMfzQmaL8L9vK8Kg LkWWW/eNJo44DJdMTY2b7W3+5jECHBojlBRB3bFoBVH/H3Hr3h60ROei9127KxixjHSd Y4YDaGnxlayyuxlda3rLKZjbx98Juc/sTYoEGlO/vNGfgfTTieL24u46R9uy228uyONQ 1rtA== X-Gm-Message-State: AOJu0YyAzQ+Gc1/iTfTz5pmSXCx4C7Kxph3Uws3N38rPcZclNV3RMeSu cOC672M6WR/cWLNDEM7+RXqkX6u5ytnlhe//yIqE++aO X-Google-Smtp-Source: AGHT+IFN5j8OVR4X2Xqr29YsERx2OQk0/yyS0S2b6Ps9DNCCFwRd5oo8Uyyt5e0e+zrY/mxpikGwtgB0gFDJdo+vc4Q= X-Received: by 2002:a05:6e02:20cb:b0:349:36e1:10fb with SMTP id 11-20020a056e0220cb00b0034936e110fbmr12995607ilq.18.1696209765560; Sun, 01 Oct 2023 18:22:45 -0700 (PDT) MIME-Version: 1.0 References: <6877754c-dcb7-db34-dd39-419de060ad7a AT linetec DOT nl> In-Reply-To: <6877754c-dcb7-db34-dd39-419de060ad7a@linetec.nl> From: "Erich Heinzle (a1039181 AT gmail DOT com) [via geda-user AT delorie DOT com]" Date: Mon, 2 Oct 2023 11:52:34 +1030 Message-ID: Subject: Re: [geda-user] PCB silk layer image script To: geda-user Content-Type: multipart/alternative; boundary="0000000000008a76d10606b19c76" Reply-To: geda-user AT delorie DOT com --0000000000008a76d10606b19c76 Content-Type: text/plain; charset="UTF-8" I have three approaches to pcb artwork The simplest is image2footprint, which works well for bitmap graphics https://github.com/erichVK5/image2footprint The catch is, gEDA PCB does not have a distinct soldermask layer that is editable, limiting the full range of effects possible. There are better alternatives for pcb-rnd, including the parametric bitmap() footprint which can be launched from the footprint library window http://repo.hu/cgi-bin/pool.cgi?project=pcb-rnd&cmd=show&node=bitmap and for more advanced effects, there is the parametric image2footprint version for pcb-rnd which does Floyd Steinberg dithering or closest match to menu selectable silk screen, copper (ENIG vs Pb/Sn) and solder mask colours http://repo.hu/projects/edakrill/user/erichvk/footprint/image2footprint.krill.tar.gz Finally, for vector artwork, there is the inkscape2pcb extension for Inkscape which can save in gEDA PCB and pcb-rnd file formats. Although pcb-rnd has native support for gEDA PCB footprints, the inkscape exporter takes advantage of the polygon in footprint support of pcb-rnd to export any non self intersecting paths as polygons on a distinct layer as well. pcb-rnd also allows scaling of any footprint in the buffer. https://inkscape.org/~erichVK5/%E2%98%85inkscape2pcb Regards, Erich On Sun, 1 Oct 2023 23:50 Richard Rasker (rasker AT linetec DOT nl) [via geda-user AT delorie DOT com], wrote: > Hi all, > > Every now and then, questions pop up about converting a logo or other > image into a silk screen element, and many answers involve a more or less > manual process using Inkscape combined with pstoedit. Also see the thread > 'PCB jpg to silkscreen' here, starting 7 November 2019. > > As I found I had to look up the details again every time, I decided to > create a script by the name of pcbsilk that automates most of the process > -- see attached file. It requires imagemagick, potrace and pstoedit to > work, and accepts several common image formats (JPG, PNM as well as EPS). > > How it works: > > It first checks whether a width is specified for the resulting silk layer > element. If no width is specified, it defaults to 40 mm. > > Then it checks if the input file is an EPS file already; if not, it uses > imagemagick's convert to convert the image to PBM format, which is then fed > to potrace to create an EPS file. The resulting EPS file is then converted > into a PCB silkscreen element using pstoedit. > > But even though it works sort of OK, there are a few annoying things that > I haven't been able to fix (apart from several smaller refinements): > > - When specifying width in millimeters, things work up to 73 millimeters > but throw a sort of overflow error above that value: > > $ pcbsilk -W 74mm testlogo.jpg > double free or corruption (!prev) > /home/richard/scripts/pcbsilk: line 36: 15520 Aborted (memory > dumped) pstoedit -q -f "pcbfill" -ssp $silkname.eps $silkname.pcb > > The actual size itself does not seem to cause the problem, as inch sizes > (e.g. -W 74in) work just fine. So it seems that it is the millimeter units > that somehow have a limited range -- not in potrace (where the width is > specified), but in pstoedit. I could of course work around the problem by > converting millimeter sizes into inches before calling pstoedit, so I think > that's what I'll do. > > - Specifying a width of course also does not work for EPS files, as any > scaling is done before conversion to EPS. Is there a way to specify width > in pstoedit? Or is there an easy tool to scale an EPS element without > having to parse the file myself? > > - The pstoedit command produces a PCB file with default workspace > dimensions (6000 x 5000 mil here), with the silk image at the bottom left. > Is it possible to (temporarily) adjust this default to fit the image size? > > Thanks for comments, corrections and of course solutions! > > Best regards, > > Richard Rasker > --0000000000008a76d10606b19c76 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have three approaches to pcb artwork
<= br>
The simplest is image2footprint, which works wel= l for bitmap graphics

https://github.com/er= ichVK5/image2footprint

The catch is, gEDA PCB does not have a distinct soldermask layer tha= t is editable, limiting the full range of effects possible.

There are better alternatives for pcb= -rnd, including the parametric bitmap() footprint which can be launched fro= m the footprint library window


and for more advanced effects, there is the parametric i= mage2footprint version for pcb-rnd which does Floyd Steinberg dithering or = closest match to menu selectable silk screen, copper (ENIG vs Pb/Sn) and so= lder mask colours


Finally, for vector artwork, there is the inkscape2pcb extension = for Inkscape which can save in gEDA PCB and pcb-rnd file formats. Although = pcb-rnd has native support for gEDA PCB footprints, the inkscape exporter t= akes advantage of the polygon in footprint support of pcb-rnd to export any= non self intersecting paths as polygons on a distinct layer as well. pcb-r= nd also allows scaling of any footprint in the buffer.






=20 =20 =20

Hi all,

Every now and then, questions pop up about converting a logo or other image into a silk screen element, and many answers involve a more or less manual process using Inkscape combined with pstoedit. Also see the thread 'PCB jpg to silkscreen' here, starting 7 November 2019.

As I found I had to look up the details again every time, I decided to create a script by the name of pcbsilk that automates most of the process -- see attached file. It requires imagemagick, potrace and pstoedit to work, and accepts several common image formats (JPG, PNM as well as EPS).

How it works:

It first checks whether a width is specified for the resulting silk layer element. If no width is specified, it defaults to 40 mm.

Then it checks if the input file is an EPS file already; if not, it uses imagemagick's convert to convert the image to PBM format, which is then fed to potrace to create an EPS file. The resulting EPS file is then converted into a PCB silkscreen element using pstoedit.

But even though it works sort of OK, there are a few annoying things that I haven't been able to fix (apart from several smalle= r refinements):

- When specifying width in millimeters,=C2=A0 things work up to 73 millimeters but throw a sort of overflow error above that value:

$ pcbsilk -W 74mm testlogo.jpg =C2=A0
double free or corruption (!prev)
/home/richard/scripts/pcbsilk: line 36: 15520 Aborted =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (memory dumped) pstoedit -q -f "pcbfill" -ssp $silkname.eps $silkname.pcb

The actual size itself does not seem to cause the problem, as inch sizes (e.g. -W 74in) work just fine. So it seems that it is the millimeter units that somehow have a limited range -- not in potrace (where the width is specified), but in pstoedit. I could of course work around the problem by converting millimeter sizes into inches before calling pstoedit, so I think that's what I'= ;ll do.

- Specifying a width of course also does not work for EPS files, as any scaling is done before conversion to EPS. Is there a way to specify width in pstoedit? Or is there an easy tool to scale an EPS element without having to parse the file myself?

- The pstoedit command produces a PCB file with default workspace dimensions (6000 x 5000 mil here), with the silk image at the bottom left. Is it possible to (temporarily) adjust this default to fit the image size?

Thanks for comments, corrections and of course solutions!

Best regards,

Richard Rasker

--0000000000008a76d10606b19c76--