
There are more functions for advanced users, read the source if you are interested. ImageData /*read the source for details*/ IndexedImage /*read the source for details*/ String filename, HashMap options /*can be null*/, byte palette /*can be null*/ ImageData imgd, HashMap options /*can be null*/, byte palette /*can be null*/ put( "blurdelta", 20f) // smaller than this RGB difference will be blurred // Palette // This is an example of a grayscale palette // please note that signed byte values will be converted to in the getsvgstring function byte palette = new byte įor( int colorcnt= 0 colorcnt options /*can be null*/, byte palette /*can be null*/īufferedImage image, HashMap options /*can be null*/, byte palette /*can be null*/ put( "blurradius", 0f) // 0f means deactivated 1f. put( "viewbox", 0f) // 1f means true 0f means false: fixed width and height // Selective Gauss Blur options. put( "desc", 1f) // 1f means true 0f means false: SVG descriptions deactivated options. put( "roundcoords", 1f) // 1f means rounded to 1 decimal places, like 7.3 3f means rounded to 3 places, like 7.356 etc. put( "colorsampling", 1f) // 1f means true 0f means false: starting with generated palette options. Options HashMap options = new HashMap() Warning: if the outfilename parameter is not specified, then this will overwrite. background field is removed from the results of color quantization.colorquantization() needs now only imgd, palette and options as parameters.getsvgstring() needs now only IndexedImage (tracedata) and options as parameters.This can filter noise and improve quality. new options.blurradius : setting this to 1.5 will preprocess the image with a selective Gaussian blur with options.blurdelta treshold.new lorsampling : color quantization will sample the colors now by default, can be turned off.new options.viewbox : setting this to true will use viewBox instead of exact width and height.new sc : setting this to false will turn off path descriptions, reducing SVG length.This can reduce SVG length significantly (>20%) with minor loss of precision.

new options.roundcoords : rounding coordinates to a given decimal place.transparency support: alpha is not discarded now, it is given more weight in color quantization.Bugfix: CSS3 RGBA output in SVG was technically incorrect (however supported by major browsers), so this is changed.This is a port of imagetracer.js: Check this out for a refactored version with better color quantization algorithm: Check this out for a C++ port: 1.1.2 Simple raster image tracer and vectorizer written in Java for desktop.
