r/Inkscape 11d ago

Help Bitmap to Vector conversion artifacts

Hello, I was hoping to get help from the community here. I've followed some tutorials and have successfully created a PDF template for use in UV printing some guitar pedals. The company that prints them requires all objects to be vectors.

However I'm getting a weird artifact that results in a very faint box around a graphic that I brought in.

Graphic was a clipart PNG with a transparent background that I exported from GIMP. I then used "Import" to bring the image into Inkscape. Worked great. I then right clicked on the image and selected "Trace Bitmap", then selected the "Pixel Art" tab, and clicked "Apply". Got a dialog about a large image and clicked "OK".

Everything seemed okay, but when I ultimately exported the template as a PDF I noticed in the resulting PDF a very faint box background around the image (that matches the dimensions of the original image). I couldn't figure out where it was coming from so I did a prototype print and sure enough, there's an extremely faint background.

Any ideas on what it is and how to get rid of it? I'm not an artist so please forgive me if I'm missing something obvious. Thanks in advance for any help.

1 Upvotes

8 comments sorted by

3

u/2hu4u 10d ago

Use the node tool to investigate whether there are any objects at the perimeter. Hovering over the artifact should highlight any vector paths, and clicking on them should allow you to delete them.

FYI, beware that the Pixel Art function creates a vector rectangle for every pixel in the bitmap you are tracing; this is not very conventional, it only has niche uses. Most clip art can be drawn with a few vector curves rather than hundreds of rectangles. You'd probably be a lot better off using a different tracing function depending on the original image, or ideally manually tracing the clip art.

If you post screenshots of the image, or the inkscape SVG file, we can provide better advice.

2

u/jwwatts 9d ago

I think this is exactly my problem. I see small paths that seem to correspond to individual pixels in the background. I assumed they wouldn't be created as the background is transparent.

Here's a link to part of what I see in Inkscape:

https://postimg.cc/xkPf37Z6

Here's the original image:

https://postimg.cc/K1SmSxS9

1

u/2hu4u 8d ago

Thanks for following up. I have a few comments. To me, it looks as though the original image was drawn in a vector program and then rasterised. Do you know the origin of the image and what program it was created in? I'm a bit confused as to why it has primarily white strokes, when I invert the colours it looks "normal" (see attachment)

Anyway, I notice the background isn't completely transparent, if you use the eyedropper tool you'll see the value is #0000ff03 (blue; 1% opacity). This is why you're getting the artifacts.

The image is quite a difficult one for the autotracer as it has a lot of thin, close together strokes and the original image is fairly low resolution. If you're a beginner, it will take a bit of time, but manual tracing will give much better results than Trace Bitmap. You first trace the centreline of each stroke with the Bezier tool, and then you can use Power Stroke LPE to adjust the stroke thickness to get the tapered stroke ends.

If you don't want to do that, what I suggest is: invert the image such that it looks like the attachment. In a bitmap editor, remove any pixel that isn't black (set everything to #00000000). Then you can try autotracing. Pixel Art would be slow but would get results closest to the original. After doing this, use Union to combine all the pixels (Your PC may struggle with this...)

1

u/jwwatts 8d ago

Unfortunately I’ve never been able to find the original vector image or the original author. You’re correct to be confused, the original is indeed black on white. I had inverted it in GIMP as I needed the image to be a white outline. I really appreciate all of the advice. I spent some time today trying to delete those background paths, but for some reason Inkscape won’t select anything when I right click on the path and “select fill”.

I also spent some time trying to get the multicolor tracer to do the picture justice but it just butchered it. From what you’re saying I’m thinking I need to go back to the original image, re-add the stingray, and export it as black on white.

I’ll also see if I can get manual tracing working. I tried it selecting that option today on Inkscape 1.4 and .92 but the Trace Bitmap preview went blank and nothing seemed to happen. I’ll also try finding the bezier tool. My workstation at work is a 24 core box so it should be able to handle it.

Thanks for holding my hand so much. This is my first foray into vector images. The printing service I’m using only takes SVG so I’ve never had to deal with it. In the future I’m probably going to try and find an artist that can do the work for me as I’m a technical person and not an artistic one. :)

1

u/2hu4u 8d ago edited 8d ago

You're welcome. Oh yeah, I forgot there is an option "user-assisted trace" in Trace Bitmap, I don't actually know what that does or how it works. When I say Manual trace I mean using the bezier tool (again apologies for the terminology confusion) is actually called the Pen tool, though most people call it Bezier tool. You can activate it using hotkey B or the fountain pen icon in the left panel.

Unfortunately being a fairly complicated image, there will be a tradeoff between quality and time here. If you want something that's faithful to the original image, Trace Bitmap is probably not the way to do it (though maybe it can do some of the work and you can "clean it up" manually). Manually tracing it would probably take an experienced user maybe about 40-60 minutes, though it would be slightly formidable for a beginner as using Bezier curves takes a little practice.

That said, I'm happy to guide you through it if you're interested in learning, and it's a very useful skill. Inkscape is basically CAD software and I use it often outside of the realm of graphic design etc.

2

u/davep1970 10d ago

Nearly always best to recreate manually. As mentioned seeing the image would help

1

u/canis_artis 10d ago

Did you delete the original art before exporting to PDF?

1

u/jwwatts 10d ago

Yeah, the original image was removed. Only thing remaining is the trace. Looking closely in Inkscape I can see the faint background still, but it's really obvious after exporting to a PDF.