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
- Golang lambda upload image into s3 static website
- Put an image behind the title in a WP, WooCommerce "shop" page
- How to create an JSOUP element from byte array image (Load from Database)
- Cloudflare not respecting Cache-Control
- Sending multiple images and data in a single angular observable
- Create and combine several images into a single image for my react native App
- Should I compress images in java backend before sending to frontend?
- Javascript Place Image Where User Clicks
- Whitespace in document has a bottom border remnant or some other line at the bottom of the whitespace
- Sony Spresense Camera Board
- After completely installation and done all the work i am getting Permission denied error do any one have solution
- HTML page on NAS server image not showing on mobile phone
- mouse coordinates in image go below 0 and above width
- Why are the css images or js not loading in my laravel project?
- Python pillow library text align center
Related Questions in ALGORITHM
- MCNP 6 - Doubts about cells
- Given partially sorted array of type x<y => first apperance of x comes before first of y, sort in average O(n)
- What is the algorithm behind math.gcd and why it is faster Euclidean algorithm?
- Purpose of last 2 while loops in the merge algorithm of merge sort sorting technique
- Dots and Boxes with apha-beta pruning
- What is the average and worst-case time complexity of my string searching algorithm?
- Building a School Schedule Generator
- TC problem 5-2:how to calculate the probability of the indicator random variable?
- LCA of a binary tree implemented in Python
- Identify the checksum algorithm
- Algorithm for finding a subset of nodes in a weighted connected graph such that the distance between any pair nodes are under a postive number?
- Creating an efficent and time-saving algorithm to find difference between greater than and lesser than combination
- Algorithm to find neighbours of point by distance with no repeats
- Asking code suggestions about data structure and algorithm
- Heap sort with multithreading
Related Questions in COLORS
- Wrong matches between colors and values when defining colorFactor
- I want write code to predict CIE XYZ from LED driver R,G,B output value
- Finding a specific colour within a bitmap range - VB.net 2022
- In Flutter, is there a way to determine the user's skin color settings for their emojis?
- HDR video publishing
- make selected text visible in PGAdmin 4 Query Editor
- How to change x-axis group labels of my boxplot in R
- flutter stripe_android:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.tasks > Android resource linking failed
- I would like a table where cells are colored (defined by values)
- Color Thresholding JS, Average Image Color Detect JS
- Assign visually distinct colors to graphs with undirected edges
- Change text color inside offcanvas navbar
- To set Different Colors For each line in Line Chart Using NPOI excel nuget package in .Net6 Core
- Is there a way to affect the interpolation between translucent colours in WPF?
- How to change the color of an icon when hovered over
Related Questions in VECTORIZATION
- Optimizing Memory-Bound Loop with Indirect Prefetching
- How to convert DoubleVector to IntVector in Java Vector API?
- How can i get the vector register information in RVV0.7.1 when debugging with QEMU6.2?
- Why do some cryptographic signature npm packages (like superdilithium) convert text to an array of integers before signing?
- How to apply a function to the subarrays of a (m,n,n) numpy array without using a for-loop
- How to apply a function to each element of a linspace without using a for-loop
- How would you vectorize a fraction of sums of matrices (Expectation Maximization) in numpy?
- Faster way of implementing pd.replace on subset of columns
- Vectorize `scipy.integrate.nquad` integrand for use with `qmc_quad`?
- python: Vectorised Def works only on the first condition. Subsequent loops are unaffected
- 'Remapping' a Python numpy array in a 'vectorized' way?
- Getting interval cuts between two 2D numpy arrays contining a given range
- High Variance In Manual Vectorization Performance
- dask - speed up column filtering
- Intel classic compiler reports non-unit strided load in simple assignment
Related Questions in COLOR-PALETTE
- My Custom Color Palette just won't take - all grey
- Gnuplot: ramdom but deterministic color palette
- Create new customized color palette for a stacked bar chart with R ggplot
- SDL2 1-bit surface, assign one of two colors in palette to a pixel
- Why is my code using the "Paletteer" package generating an error?
- What is GIMP's algorithm for generating an optimum palette for indexed images?
- Setting colour palette based on month in a %b-%Y variable in ggplot2
- WPF Theming and Colours
- How could you prevent this rgb to colorID conversion from creating 256^3 sized arrays and still keep it vectorized?
- Why can I convert an RGB image to a 17 color palette, but no fewer? (Python Pillow version 10.1.0)
- How can I generate colours from images and set it to background of screen
- Pheatmap: mix range and specific value for color
- Use a maximum of 2 colors from a given palette to update a list of any RGB pixels
- Removing border/outline of colour fill for barplot (scale_fill_manual ggplot2)
- Using multiple continuous colour palettes in one graph (ggplot2 and/or ggfortify)
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 # Hahtags
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.