Hi
When i import a vector graphic file created in another program, All colors are changed to blue. how do i keep the original color from the graphic file? Is it even possible in Kicad? if not what other format is best for this purpose?
Thanks
I’ll assume you have imported the graphic into the PCB Editor.
Given what KiCad is, I don’t see that colours are at all relevant: if you have imported a graphic into, say, the front copper layer, then it will be the colour that the front copper layer has been set to.
KiCad isn’t a fancy colour CAD system, it’s about defining layers, which eventually get made into a PCB. the colours of the different layers are there to let you identify those layers, and you can change the colours selected for each layer, as well as choose to display / not display them.
You got it all wrong. Read the question again.
As I mentioned in the question, it is Schematic editor. I do not need to use the fancy colors for the symbols. But looking for a way to change the color to fit in to my diagram. But certainly not in blue.
Your answer is based on PCB editor, which is irrelevant for my question.
I made the same mistake as thinking this was for import on the PCB.
I do not read titles very well apparently, but paid more attention to the text in the post body.
I just did a very simple test:
- Open a project, export the schematic as a .SVG file.
- Open the symbol editor, open a symbol in it.
- Symbol Editor / File / Import Graphics and imported the .SVG I just created.
And for me it preserves the colors. Wires imported as lines are still green, light yellow rectangles. which were the backgrounds of the symbols. Text still has color #006464FF It does not preserve the Z-order. KiCad does not have a real Z-order, and some of the light yellow backgrounds were drawn over other items of the converted / imported “symbols”.
Hi
In my case I created the vector file .SVG using Inkscape. Then imported to Kicad. it is not complaining any error or anything but the imported drawing is all in blue.
May be there some compatibly issue with my saved file from Inkscape. I will do some more test.
hi
Now I tested again. It seems preserve the colors in symbol editor but not in the schematic editor for some reason.
I opened a schematic, and then imported the as .SVG exported schematic into it and it also preserves the colors.
Having both a schematic, and a schematic imported as graphics in the same editor window is a bit confusing though.
After a search I found some SVG graphics in /usr/share/icons/Adwaita/scalable/status
I copied three icons to my desktop, and imported them in a schematic file Two are distorted, the third is all blue just like you wrote.
Let’s see if these SVG pictures render in a website:
And the same SVG files zipped just in case:
2024-09-16_3_Icons.zip (5.7 KB)
So it looks like at least two different bugs (distorted vectors, and colors).
I would have to test this in a current nightly before even attempting to create a bug report for this, but I can’t run current nightlies at the moment. You can also check gitlab whether there are already issues created for .SVG imports.
I tested your images. The weird thing is if I import the images, they looks like what you also gets. Though if i import in to the inkscape and export again. then import to Kicad, the first 2 images seems correct except the last one all in Blue…
For SVG import it is generally advisable to do Path → Flatten in Inkscape 1.4 Beta before importing into KiCad to avoid the effects of non-existent Z-ordering.
KiCad’s SVG importer also intentionally replaces black color with default KiCad color because black is the default color in nanoSVG.
KiCad shouldn’t replace the color if it’s slightly different from #000000.
There’s something broken about these particular images.
Possibly so, I’m not very proficient with graphic stuff, but apparently my OS, Inkscape, Nightman, and Firefox is able to render them “properly”, but KiCad does not and that seems to be the outlier.
And I repeat: I think this is worth a bug report, but I’m not going to make one now. First because I’m not very good with pictures, second because I can’t run current nightlies, and can’t test current behavior.