Metlivi Blog

How to Preserve Interior Holes When Tracing a Bitmap in Inkscape

To preserve interior holes in Inkscape, first make sure the openings survive the bitmap’s black-and-white threshold. For a single-color character silhouette, start with Single scan → Brightness cutoff. For colored artwork, inspect the separate scans: an opening in one shape can still have another filled shape behind it.

This workflow is for someone tracing raster character artwork who needs enclosed openings to remain transparent. It focuses on threshold, color segmentation and multiple-scan output, with a practical comparison test to identify where an opening disappears.

October 29, 20266 min readBy Metlivi Editorial Team
Section 1

1. Decide which light areas should become holes

Before tracing, distinguish an intentional light-colored detail from an opening that should reveal whatever sits behind the character. A white decorative patch and a transparent opening can look identical against a white page, but your desired vector result is different.

Write down the openings you need to preserve, starting with the smallest. Use these as checkpoints throughout tracing. For example: “Keep the large central opening and the two small enclosed gaps.” This gives you a concrete acceptance test instead of judging only whether the overall silhouette looks similar.

Brightness cutoff creates a silhouette-like path, whereas multiple scans create separate objects. Choose according to whether you need one filled silhouette or several colors, rather than assuming that additional scans will preserve openings better. See the Inkscape Beginners’ Guide: Tracing an Image.

Section 2

2. Use brightness cutoff to preserve openings in a single-color silhouette

Import the bitmap through File → Import, select it, then open Path → Trace Bitmap. Choose Single scan → Brightness cutoff for dark artwork on a light background. Refresh the preview after changing settings. Inkscape’s guide documents this import, selection and preview workflow. Tracing an Image.

The threshold determines which pixels become foreground. Raising it makes the intermediate bitmap darker because fewer pixels remain white. Consequently, increasing the threshold can consume gray pixels around a small opening; lowering it can recover those pixels, although thin dark features may then disappear. This direction of adjustment follows the documented behavior of Brightness Cutoff in Inkscape’s tracing tutorial.

Use a controlled comparison:

  1. Start with a threshold of 0.50 as an illustrative trial value.
  2. Inspect your smallest required opening in the preview.
  3. If it closes, try 0.40, then compare the surrounding silhouette.
  4. If thin foreground details disappear, move back upward in smaller increments.
  5. Apply the candidate that preserves both the opening and the necessary foreground details.

Those numbers are trial settings, not measured recommendations for your image. The useful setting depends on the raster. Stop adjusting when further recovery of the hole starts removing character details you need; that tradeoff is evidence that the source needs clearer separation.

Section 3

3. Recognize when the bitmap cannot support a clean threshold

Consider an explicitly illustrative grayscale example: the character’s dark region has brightness 0.20, the opening is 0.80, and the exterior background is 1.00. A cutoff of 0.50 separates the dark region from both light regions. If compression or shading makes part of the opening 0.45, that portion can enter the foreground at the same cutoff.

This example explains why changing a threshold sometimes helps and sometimes cannot finish the job. If an intended opening and a necessary foreground detail have overlapping brightness values, one global brightness cutoff cannot reliably separate them by brightness alone.

Inspect the raster at a useful zoom before continuing. If the opening is already indistinct, clarify that region in a raster editor, then reimport and retrace. Prefer clearly separated foreground and background over repeated threshold changes. Chicago Public Library’s original maker tutorial likewise recommends high-contrast source images for tracing. How to Trace an Image in Inkscape.

Section 4

4. Reduce detail removal while diagnosing small holes

A tiny enclosed opening can be lost during detail suppression even when the basic foreground selection is suitable. Potrace’s original technical documentation describes background regions as holes bounded by curves, and its despeckling parameter removes curves below an area threshold. This supports testing small-hole loss with less suppression, rather than assuming only unwanted foreground dots are affected. Potrace Library API.

For a diagnostic trace, disable Speckles, or reduce its value where your interface permits. In a separate trial, reduce smoothing and optimization. Change one setting at a time so you can tell which adjustment restores the opening. University of Queensland’s Inkscape documentation explains that stronger Speckles, Smooth corners and Optimise settings simplify output at the expense of detail. Inkscape: introduction to vector design.

Once the opening survives, reintroduce only the cleanup you need. Compare the smallest opening after each change. A smoother outer contour is not a useful improvement if it removes an essential gap.

Section 5

5. Inspect multiple scans for shapes behind the opening

For colored artwork, open the Multicolor/Multicolour section, labeled Multiple scans in some interfaces. The result contains separate scan objects; Inkscape’s guide demonstrates ungrouping them for inspection. Keep a duplicate of the assembled result before moving individual scans. Tracing an Image.

The Stack option places scans over one another to avoid gaps between adjacent color regions. That overlap has a practical consequence: an opening in an upper scan may reveal a lower filled scan. The complete artwork can therefore look correct against white while still lacking transparency through the assembled result. The overlap behavior is documented in University of Queensland’s tracing instructions; the transparency consequence follows from that structure.

Create a second trace with Stack disabled, keeping the other settings unchanged. Compare the required openings in both outputs. Treat this as a structural test: disabling stacking changes overlap behavior, but does not automatically classify every light interior detail as empty space.

Try Remove background, then inspect what remains. Do not judge success from that checkbox alone: Queensland’s documentation notes that a background can remain depending on image contrast. An interior color region may also be something you intend to keep, so inspect the result before discarding any scan. Inkscape: introduction to vector design.

Section 6

6. Use this decision table to choose your next trace

What you observe What to test next What the comparison tells you
The opening is absent in the single-scan preview Lower the brightness threshold Whether light pixels are entering the foreground
The opening survives only with cleanup reduced Reintroduce cleanup settings individually Which setting removes the small feature
A colored result looks open, but an isolated scan is filled underneath Compare Stack enabled and disabled Whether overlap contributes to the filled appearance
The exterior background disappears but the interior remains colored Inspect individual scans Whether a separate color region still occupies the opening
Recovering the opening also erases required foreground detail Clarify the raster’s foreground/background separation Whether the source supports the intended segmentation

Use the table in order rather than changing every control together. The goal is to identify the first stage where the intended opening is lost: source separation, threshold selection, detail suppression or assembled scan coverage.

Section 7

7. Verify transparency before keeping the result

Move the applied trace away from the original bitmap before inspecting it. The new vector is created directly above the source, which can conceal differences between them. Both the Inkscape guide and Chicago Public Library’s tutorial recommend separating the trace from the bitmap for examination. How to Trace an Image in Inkscape.

Place a temporary rectangle in a contrasting color behind the vector. Every intended hole should reveal that rectangle. For multiple scans, test the assembled group as well as the relevant individual shapes; a clear opening in one object does not establish transparency through the whole stack.

Keep the result only after the smallest required openings pass this check and the surrounding character details remain intact. Preserve the source bitmap separately so you can retrace with clearer segmentation if needed. This makes hole preservation a repeatable tracing decision: establish the light region, retain its boundary, and verify that no other scan occupies it.

Section 8

Sources

Related reading

Keep exploring this topic