This blog is now retired. Please visit our new blog here.

There are some guides on adding a logo to KiCAD and making PCB artwork in KiCAD, but as they are from an earlier version, they still recommend using an web based or awk script re-scaler.

Since KiCAD has been updated to allow rescaling in Bitmap2Component by setting the DPI value, this is now unnecessary.

The easiest way (when using a tool like Inkscape) is to resize the vector image to the required physical size of the logo and then export a .png file with a suitable number of pixels for the output size. I've been using 1024 pixels for a 12mm logo, but as long as the indicated resolution during the export is above 300, then there should be enought detail for KiCAD to make a good component.

Now when you load the bitmap, Bitmap2Component will take the value of DPI that has been set by Inkscape, and the resultant footprint will be the same size as the original vector.

Sometimes you aren't working from an original vector, and you don't get the choice to change the size and re-export from an original. In that case, you can do a little maths to be able to work out the exact DPI value required to give the component footprint of the right size.

$$ \text{DPI} = \frac{\text{No. Pixels} \times 25.4}{\text{size in mm}} $$

or

$$ \text{DPI} = \frac{\text{No. Pixels}}{\text{size in inches}} $$

If you're not sure the size of the image, it's shown at the top of the Bitmap2Component window. To keep the image in the same aspect ratio (so it doesn't look squished in any direction) choose to set either the width or height of the image, and use the same DPI value for both resolution values.

Import the footprint in a library

While I initially thought that the kicad_mod file could just be added as a KiCAD library directly, this just led to a complaint about an invalid library type.

The information that I was missing was that the mod file needs to go in a .pretty directory. It appears that only a folder named <something>.pretty is what's counted as an acceptable library format, though the folder may contain any number of footprint files.