Skip to content

jujumo/inkex_color_trace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Color from Bitmap : Inkscape extension

version 1.0

brief

Grab color from underlying bitmap and apply it to path objects. The color is averaged all over the path area. Erode parameter can be used to shrink or expand (using negative value) this area.

example klimber

Options

  • Fill color: How to replace the inner color of selected shapes. It can be unchanged, nofill (Empty color), average.

  • Stroke color: How to replace the stroke color of selected shapes. It can be unchanged, nofill (Empty color), average.

  • Erode: Erode (see morpho math transformations) of the shape. It can be used to emphasize the contrast. If negative value is given, it will dilate the area, and then smoothen the contrast between adjacent areas.

  • Show debug image: will display an image ini external viewer for debug purposes.

Known limitations

  • Only consider a single image. If multiple bitmaps are selected, only one is considered.

  • Only handle path objects: does not work on rectangles, circles, …​ Make sure to convert objects to paths.

  • Only works with straight paths: bezier area are approximated using straight lines.

  • Dilatation (negative erosion) have weird corners.

  • Ignore any clipping on the image.

  • slow

Low poly example

In this example, I describe how to use this extension to speed up a low poly design.

First, place markers at key places (triangles corners). See below example.

dots

Then generates a triangle mesh, using a delaunay triangulation, as shown below:

menu1
dialog1

Once you have the following mesh,

mesh

you can colorize it, using the "from bitmap" color extension. Make sure you have both the image and the mesh selected.

menu2

Choose your settings, and apply.

dialog2

You should end up with colorized objects, like below:

colorized

About

inkscape extension: color objects from bitmap

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages