HOW TO IMPORT AN IMAGE INTO ALTIUM WITHOUT LOSING YOUR FREAKING MIND, PART 1
by Carrie Sundra
This is a 3-part tutorial. Scroll to the bottom to go to the next page!
What - you think paying $7000 once plus $2000 yearly for THE premium circuit board layout software on the market would mean it would be no big deal to stick a logo or graphics on your PCB? Or at least that your money was enough to pay them for a nice step-by-step tutorial? HA. Think again. It's such a painful process that I finally had to make myself a cheat sheet, which I continuously add to as I figure out new tricks. And then last week I spent way too much time on the heart design above and was like - fuck it. I'm sharing this with the world because it's just ridiculous that importing graphics is this much of a pain in the ass. So if you've banged your head against the wall importing a logo into Altium Designer, here's a How To guide with 2 different ways, using a bitmap, png, jpg, and dxf. Got another method? Got improvements on the below? Let us know! For the Love of Bob, no one should have to go through hours of misery trying to figure this out.
Also - kudos to the KiCad designers and whoever made their import tool. While it could be better, it puts Altium to shame.
Method 1 - PNG to DXF
I think this is the best method I've been able string together. It's best for an image with very clear edges, in which a clean outline can be created from the image or image components. For anything that has pixelated or rough edges (think a wood-carved ink stamp), this method creates a dxf (and therefore final image polygon) with waaaaaay to many vertices. Altium has a hard time handling this and you’ll bog the entire program down and cause crashes. For something a little “rougher” - hand-drawn, or a graphic from a photo - proceed to Method 2.
- Start with a black and white PNG file. It doesn't have to be fully monochrome, and you might get smoother edges in the next step if you keep it grayscale. Here's what I started with:
- Convert your PNG to a DXF. I’ve had great luck using Convertio, which you can install as an extension to Chrome. I have NOT had any luck in Inkscape using “Save as” and then selecting DXF as the file type. I'm not sure why, I’m sure there’s a way if I spent more time on it.
- Import your DXF as a layer into Altium. Sometimes there’s fuckery with the scaling and initial placement, so it may be best to try this in a new PCB file. Go to File -> Import -> DXF/DWG. Import it to a mechanical layer, I use Mechanical Layer 2. Make sure you select an import center point that allows your entire image to be in your working area (up and right of 0,0). Some files will send your image all over the place - you may have to hunt for it. Shortcut keys V-F and V-D are useful for finding your image and your document. Also make sure your scaling is correct, and the image is big enough for you to actually see.
- Unionize. You’ll note your DXF is all outlines of your original image. Group it as a Union and then use the Union Resize tool to make it the size you want. It should scale quite cleanly, unlike the other methods below.
- Select your outlines. In order to properly convert your shape to a fill or region, it's best to have a completely closed outline. If you don't, it's not the end of the world as long as the outer edge of your outline is closed. There are some tricks here to selecting - if you have a complicated shape that’s close to other shapes and hard to select on its own, move your entire image to a copper layer. Then use the Select Connected Copper tool to select a complex outline. Note that only the outer outline of the # sign is selected.
- Convert to a Polygon. Make the active layer the one that you want your image to be on. Use Tools -> Convert -> Convert -> Create Polygon from Selected Primitives. If it’s a very simple shape, you can use Create Region from Selected Primitives instead, but be aware that you can’t do cutouts or connect it to a net. For this shape, where we want the center of the # sign to be cut out, we use Create Polygon. You should then have a shape that looks like this:
- Define the cutout. You'll have a weird fatty outline that’s still not filled in, and it might not look completely connected in places. It’s OK, ignore the weirdness. If you have a cutout like we do, don’t do anything with the polygon yet. Select the center outline using the Select Connected Copper tool, and then Tools -> Convert -> Create Cutout from Selected Primitives. (You can also create a Board Cutout this way if you way to). It will look like nothing happened, but don’t worry, something did.
- Verify the cutout. Click anywhere to deselect, and you’ll note there’s now a dashed line around the center traces. Click in the middle of the cutout and verify that you can now choose “Polygon Pour Cutout” and verify it’s on the Top Overlay layer.
- Adjust Polygon settings. Now back to your Polygon. Click anywhere between the cutout and your polygon outline, and select the polygon. Uncheck “Remove Dead Copper” and select “Solid” for the fill mode tab. If you have very pointy bits like we do, uncheck “Remove Necks less than…” and if your object is very small, you may need to uncheck “Remove Islands less than…”.
- Repour! Click Repour. If you’ve set up the checkboxes and the cutout correctly, you should have a nice clean pour of your object:
- Move and save your outlines. There's a fair chance you might want a do-over at some point, and saving your outlines will save you time. If you’ve moved them to a copper layer like we did above, you'll want to move them to a mechanical layer. Select the whole thing, then deselect the polygon and the cutout, leaving just the outlines selected. Then choose a mechanical layer under "Properties" for your selected outline. You can make it a hidden one if you don't want to see them or be able to accidentally select them again.
- Type the text. I decided that one of my installed fonts looked better than the handwriting, so I deleted the "You're" objects and used a normal Altium text object. One note - initially the font was not showing up properly and some default was used. I looked at the font on my system and realized it was an OpenType font instead of a TrueType. I installed the TrueType version, and the text showed up fine. Another note - it showed up fine until I went to make an Assembly Drawing PDF. For whatever freaking reason that I will never understand, I had to uncheck the "Display TT Fonts" checkbox for the Top Layer. Then it exported to the PDF properly. WTF. No idea. Altium.
The "# 1 ! " were all imported from the DXF according to this process. The "1" and "!" were converted to Regions instead of Polygons, since they didn't need cutouts. Curious about the rough heart outline? That was imported according to Method 2 - Bitmaps to Copy/Paste from Word. The smooth heart board outline was drawn by hand in Altium, outlining the rough heart by using the Arc (Any Angle) tool and a couple of straight lines. I had tried to use an imported dxf for the board outline, and everything seemed fine. I saved my work, shut down Altium properly, then when I opened it the next day, I was greeted with the following vision of pink puke:
WTF, Altium? Pro tip: at this point I closed the PCB file and went into the History folder in my project, and started unzipping previous saves until I found one that was normal. Fortunately, it just seemed to have barfed when I created the board outline. So I decided to play it safe and draw a low-vertex-count one by hand. That one has been fine.