nickvdw / image-to-voronoi Goto Github PK
View Code? Open in Web Editor NEWConvert an image into a nice-looking Voronoi diagram using one of many available techniques with options for customization.
Convert an image into a nice-looking Voronoi diagram using one of many available techniques with options for customization.
We can take a look at using contrasts to generate centroids instead of greyscaling. Contrasting may highlight some important borders that could be used to generate centroids to make better Voronoi diagrams.
You could also allow the user to select the region they want to be converted to Voronoi. This user selection could prevent that less important areas in an image are going to be full of centroids and to eventually 'steal the show'.
Shape/Face recognition techniques could also be used. This requires some form of ML.
A link that could be useful for this issue:
https://github.com/MauriceGit/Voronoi_Image_Manipulation
We can use
https://github.com/LinusU/resize-image-data
and add the following code in imageHandler.js
image.addEventListener("load", () => {
const aspectRatio = image.width / image.height;
canvas.width = image.width;
canvas.height = image.height;
context.drawImage(image, 0, 0);
const imageData = context.getImageData(0, 0, image.width, image.height);
const newWidth = image.width / 10;
const newHeight = newWidth / aspectRatio;
const result = resizeImageData(
imageData,
newWidth,
newHeight,
"nearest-neighbor"
);
console.log(result);
resolve(result);
});
Advantages:
Disadvantages:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.