Is there any library for converting a raster image to a vector one limiting the number of sampled colours to a specific set? Something like what is done in VectorMagic but giving a subset of colours to be used.
Raster to vector conversion library
9.8k Views Asked by Claus At
2
There are 2 best solutions below
0
Andras
On
Imagetracer is a free and open source (Public Domain) library and application which might be useful. Disclaimer: I made these.
If you need a command line application, I recommend ImageTracer.jar from
https://github.com/jankovicsandras/imagetracerjava
with options like these
java -jar ImageTracer.jar input.png outfilename output.svg numberofcolors 4
to limit the number of colors to 4. If you call the library from a Java program, you can use custom palette, and there are many other options.
You can use the JavaScript version from the browser or with Node.js: https://github.com/jankovicsandras/imagetracerjs
Related Questions in IMAGE
- Add image to JCheckBoxMenuItem
- Display images on Django Template Site
- How to resize images with PHP PARSE SDK
- Animation in Java on top of JPanel
- Slow performance on ipad erasing image
- What are the pros and cons of the picture element?
- Carrierwave file upload with different file types
- How to use annotorious with angular
- Images not showing when uploaded to server
- ImageView doesn't show up
- Image Resizing adjusts ratio
- Displaying bitmap image on Android (OpenCV)
- Class 'Imagick' not found - PHP and Windows
- Image position - randomly select position
- Replace image 1 with image 2 after 5 sec
Related Questions in ALGORITHM
- Two different numbers in an array which their sum equals to a given value
- Given two arrays of positive numbers, re-arrange them to form a resulting array, resulting array contains the elements in the same given sequence
- Time complexity of the algorithm?
- Find a MST in O(V+E) Time in a Graph
- Why k and l for LSH used for approximate nearest neighbours?
- How to count the number of ways of choosing of k equal substrings from a List L(the list of All Substrings)
- Issues with reversing the linkedlist
- Finding first non-repeating number in integer array
- Finding average of an array
- How to check for duplicates with less time in a list over 9000 elements by python
- How to pick a number based on probability?
- Insertion Sort help in javascript -- Khan Academy
- Developing a Checkers (Draughts) engine, how to begin?
- Can Bellman-Ford algorithm be used to find shorthest path on a graph with only positive edges?
- What is the function for the KMP Failure Algorithm?
Related Questions in COLORS
- X3DOM Inline Background skyColor
- Set Background Color on UIButton when Disabled?
- WPF text control with colors only
- Trying to make a random pixel in a bitmap a new color, but it is giving an error why
- background is not working properly
- LWJGL Drawing colored text to the screen issue
- Python: list of strings, change color of character if found (using xlsxwriter)
- How to plot colors on CIE 1931 Color Space in Matlab?
- Change all MenuItems ForeColor at once when click a button
- Selectioncolor doesn't work within KeyPress event
- Change color button in Kivy
- Matlab - Using symbols in gscatter
- Java replacing the background of an image
- Java JMapViewer: How can I change the color of a MapPolygon?
- How do I change symbol type colors on D3js?
Related Questions in VECTORIZATION
- OpenMP SIMD on Power8
- Improve Speed of Piecewise Function in MATLAB
- Vectorization using accumarray
- Store, modify and retrieve strings with GCC Vector Extensions?
- replace zero values with previous non-zero values
- Compare two 16-byte values for equality using up to SSE 4.2?
- Matlab reshape back into original image
- R - Vectorized implementation of ternary function
- Fast celllarray by matrix multiplication
- How to check if any words in a list of phrases are contained in a list in R?
- Factorial of a matrix elementwise with Numpy
- how to calculate a 2D array with numpy mask
- Return element from vector A or B based on value of Vector C or D
- trying to vectorize this operation in R and I don't see why this is wrong
- Interpolation for missing values
Related Questions in COLOR-PALETTE
- html5 canvas circle palette
- Grabbing color palette from YouTube thumbnail
- PBO Indexed Color Texture Rendering with Palette in Fragment Shader not working
- HTML5 Canvas circle palette need custom size
- Abstract fields implemented by static final class?
- How do I combine similar elements in a list in python?
- How to read a palette image as a scalar image with ITK?
- Change size array in ColorPalette.Entries
- error: Error: No resource found that matches the given name: attr 'colorAccent'
- Multiple palettes and empty labels from file entries using matrix with image in gnuplot
- Display custom color dialog directly- JavaFX ColorPicker
- Simple swift color picker popover (iOS)
- How can I attach a list of custom color palettes to a list of ggplot objects without printing each plot object to the screen?
- Use a color palette for matrix points in UpSetR
- How do I make a lighter version of a colour using PHP?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is the opensource library/program potrace which performs a fine vectorization. The thing is it first converts the input image into a luminensce one, and then binarize it. This step is optional, made by a separate program, so you can use potrace but in a different manner, by constructing yourself several versions of binarized images. I think VectorMagic builds its contours based on the gradient/laplacian of the input image, that's why you cannot impose any set of colours.
If you have a subset of colours to be used as input, I advise you to folow the following algorithm:
At the end, you will get a set of contours. Maybe the contours would not match exactly, but there would be sufficiently close to let you simplify them and delete properly doublons of contours.