2

Dear community,

I just started using Inkscape but face some "simple" problems already. As you can see in the screenshot if I trace bitmap the Canadian flag without the "remove background" option it creates a white background on my png file, which I don't want. If I trace bitmap it with the option "remove background" it also removes the white IN the picture. Is there a simple way to overcome this issue?

Edit: I also have a more complex example with a similar issue

enter image description here

6
  • 1
    This isn't an actual answer to the question, but I'd like to point out that there are already public domain (copyright free) SVG images for the Canadian flag on Wikimedia Commons, which will give you much, much cleaner and more accurate vectors than tracing ever could: commons.wikimedia.org/wiki/File:Flag_of_Canada.svg and commons.wikimedia.org/wiki/File:Flag_of_Canada_(Pantone).svg You can even import it directly inside Inkscape via the 'File → Import Web Image...' dialog (switched to 'Wikimedia').
    – Xrott
    Commented Oct 28, 2023 at 11:55
  • Crop the image to the size of the flag in a raster image editor. Import the cropped image into Inkscape, then trace bitmap without using background removal.
    – Billy Kerr
    Commented Oct 28, 2023 at 12:17
  • Note that Inkscape treats white and transparency in bitmaps the same when tracing. It is not alpha aware. There are other workarounds however. See this similar question.
    – Billy Kerr
    Commented Oct 28, 2023 at 12:20
  • See this example example made in Inkscape, using the cropping method
    – Billy Kerr
    Commented Oct 28, 2023 at 12:33
  • 1
    @xrott +1 and also on the Canadian Government website - you can just delete the text.
    – Billy Kerr
    Commented Oct 28, 2023 at 12:42

1 Answer 1

2

Trace Bitmap can't do what you want fully automatically. You will need to use some manual editing. How much will depend on the complexity of the image.

For a rectangular flag it's quite simple. Crop the image to just the flag, using the crop tool in raster software such as Photoshop, GIMP, Krita etc. Import the cropped image back into Inkscape, and trace bitmap without choosing the remove background option.

enter image description here

For something more complex like a logo or an image of a cartoon character, which has lots of areas of white inside it, or a white background, or a transparent background, you will have to do more manual editing after the trace, because Trace Bitmap treats transparent pixels the same as white pixels. It doesn't differentiate between transparency and white.

Anyway, this isn't a full tutorial, just the basics of how to go about such a task:

  1. Trace a bitmap image and check the remove background option

  2. Move the vector image away from the raster image, and duplicate the vector trace, and move that to the side also.

  3. Do Object > Ungroup two or three times to make sure you have no groups left

  4. Do Path > Break Apart

  5. Select all the pieces using the Select by Nodes tool

  6. Do Path > Union

  7. Set the fill to white

  8. With snapping enabled, move the white piece over the vector trace

  9. Lower the object to the bottom of the stack, and select and group all the pieces together.

Here's a real time example

enter image description here

Note: If you have areas of white which are unbounded by other colours or without an outline, you will likely have to draw a white filled shape manually using the Bézier tool, move it into position manually, and send to the bottom of the stack. If you have a transparent area totally enclosed within a graphic, you will likely have to manually create a shape, and do a Difference boolean operation to remove it from your white filled shape.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.