Image to polygon converter
Posted: Thu Mar 09, 2023 1:13 pm
Following a recent topic I had the motivation to do something I had already thought of a few times, to obtain polygons representing the convex hull of an sprite. So I made it a small tool for my personal use and I just wanted to share it if it can help people
It's a little program (made with löve, yes) where you just drag and drop an image into the window and it generates the list of vertices you want, selecting the max number of vertices you want.
The code is CC0 except for the SUIT library and nativfs which is included (I don't know if that is a problem), so what is mentioned as CC0 at the top of the file means that you do what you want with it
Small animated demo:
Example of what an exported file may look like, the program creates the file or simply adds the new table to the file:
I thought about adding the possibility of converting a whole folder at once, spritesheet management and being able to edit the vertices in the previews, I'll try to add all this when I have time or don't do not hesitate to suggest your modifications on the repository if you like
I will also propose releases for Windows and Linux on the repository when I have time too.
https://github.com/Bigfoot71/Image-to-Polygon-converter
It's a little program (made with löve, yes) where you just drag and drop an image into the window and it generates the list of vertices you want, selecting the max number of vertices you want.
The code is CC0 except for the SUIT library and nativfs which is included (I don't know if that is a problem), so what is mentioned as CC0 at the top of the file means that you do what you want with it
Small animated demo:
Example of what an exported file may look like, the program creates the file or simply adds the new table to the file:
Code: Select all
-- Normal
verts_1 = {70, 10, 159, 55, 0, 139}
-- Table of table checked
verts_2 = {{x = 70, y = 10}, {x = 159, y = 55}, {x = 0, y = 139}}
-- Normal formated
verts_3 = {
70, 10,
159, 55,
0, 139,
}
-- Table of table formated
verts_4 = {
{x = 70, y = 10};
{x = 159, y = 55};
{x = 0, y = 139};
}
I will also propose releases for Windows and Linux on the repository when I have time too.
https://github.com/Bigfoot71/Image-to-Polygon-converter