One is the bitmap2component process of opening a JPG and converting it to a library file. The second is running the plotter to generate gerbers from a kicad_pcb file.
Are either of these commands accessible from the command line in any way? Or otherwise automatable in some fashion?
There is no direct CLI invocation in Kicad to do this sort of thing but PCBNew is scriptable and has a Python abstraction layer. This is in a state of flux at present and scripting is not available on all platforms/versions. However, in macOS, you are in luck - both in 4.0.7 and 5.0.1 support python scripting. There is still a bit of finangelling required to get this to work.
There is some useful material about Python scripting here (but bear in mind the comments about the current ongoing changes).
The following script will work on macOS and will generate gerbers. Save the script somewhere in your path or run it in situ. Change the path where you want the output directory (line 11) Invoke it from the command line with the path to a *.kicad_pcb file e.g.
bitmap2component will only (AFAIK) take bitmap (bmp) images and convert them. You would have to convert from jpg to BMP first. The library format converts to polylines. I think you could probably do this with Inkscape but haven’t tried.
Oh, great news on the plotting capabilities and integration with Python!
As for bitmap2component, I have been using PNGs actually, but it’s always worked upon import. Is there a python abstraction layer to b2c by chance? I’ve tried several of the converters from SVG and always got garbled library files.
What exactly is b2c converting images to? Is that some standard kind of format that I could create in another way?
Like @Rene_Poschl said, I I have had good results with svg2mod.
The mod file format is described quite nicely here https://www.compuphase.com/electronics/LibraryFileFormats.pdf (I am sure there is a proper Kicad reference but this is one I have been referring to recently. The new format is s-expression which is a based on arcs/lines/circles and polygons so similar to svg. Have a look at both in a text editor.
There is no Python abstraction to bitmap2component nor any plans for one AFAIK. However, I would have thought that you could cobble together a workflow.
Try something like this - a little Bash script - takes all bmp in a directory, converts to same named svg and then to footprints?
for f in *.bmp; do
n=${f%.bmp}
potrace $f -s -o $n.svg
svg2mod --input-file $n.svg --output-file $n
done
A bitmap file isn’t necessarily a .bmp file. Just like a car isn’t necessarily a Ford Mustang. Jpegs, PNGs, TIFFs, ILBM (originally an Amiga image format), Targas, etc are all bitmap files. As they are maps of image bits.
I haven’t had any file format problem feeding jpegs or PNGs to b2c for logo conversion. Somehow I doubt it would read an ILBM, but I haven’t had access to any in so long that I haven’t tried. (I could be surprised and it can take it, as the choose image requester offers .iff (a common, but inaccurate, extension for ILBM) as a supported image file.)