← All guides

Gradient artwork without banding

Increase gradient sampling and color precision for shaded icons and illustrations.

Problem

Default settings favor compact output. On a small soft-shaded icon, that tradeoff can show as visible bands because neighboring colors are grouped too aggressively. A smaller gradient step and full color precision retain more of the ramp.

Command

Terminal
npx kurviq --input gradient-icon.png --output gradient-icon.svg \
  --upscale 2 --mode spline --filter_speckle 4 \
  --path_precision 1 --segment_length 8 \
  --gradient_step 8 --color_precision 8

Before and after

Air freight — gradient icon, raster input Air freight — gradient icon, traced SVG output SVG PNG
SVG: 98.0 KB PNG: 19.1 KB

Air freight — gradient icon

Layered objects, attached shadows, and gentle gradients.

The traced plane keeps the layered blue shading and rounded contours. The tradeoff is visible in the file sizes: this 19 KB raster becomes a 96 KB SVG because preserving a gradient needs more colored paths.

Workflow

1. Identify a real gradient

Use this recipe when shading carries shape or depth. If the source is supposed to use a handful of flat colors, the sharpen recipe will usually be smaller and crisper.

2. Preserve the ramp

Gradient step 8 samples changes more frequently than the default 16. Color precision 8 retains the full available channel precision instead of the default 6.

3. Accept the size tradeoff deliberately

More color layers mean more paths and bytes. Compare at the final display size and return to the defaults if the visual difference is not perceptible.

Flag reference

Flag Value Why it is here
--gradient_step 8 Uses smaller steps between sampled gradient layers.
--color_precision 8 Keeps full color-channel precision.
--upscale 2 Provides more samples for small shaded edges.
--mode spline Fits rounded illustrated forms.
--filter_speckle 4 Removes isolated color islands.
--path_precision 1 Keeps small curves accurate.
--segment_length 8 Smooths contour segmentation.
Watch for this: Gradient preservation increases SVG size and is not intended for photographs. Do not add --sharpen: it deliberately collapses the ramps this recipe is preserving.