PNG and Atlas cutter script? Legend of the Phoenix
Posted: Sat Feb 25, 2023 10:44 am
Hello xentax, I have several thousand PNG's I want to work on rebuilding, they have a JSON file that is a texture atlas in disguise,
it's contents look like this.
{"width":499,"imagePath":"lm_tex.png","height":511,"name":"lm","SubTexture":[{"width":137,"y":1,"height":250,"name":"arm_r","x":237},{"frameY":-1,"y":1,"frameWidth":114,"frameX":-1,"frameHeight":394,"width":112,"height":392,"name":"leg","x":1},
and so on and so forth.
all of the Atlas files and images have the same name and are in the same folder, nothing is encrypted or compressed.
I was wondering if someone could help me by writing a script that could take this atlas file and cut up the PNG into separate PNG's.
I will include a sample.
It wouldn't let me upload a json or txt so I had to rar it. this includes the json and png sample.
Any help on this would be very appreciated, other wise i have to do this by hand, and for some of the later PNG's that's impossible.
it's contents look like this.
{"width":499,"imagePath":"lm_tex.png","height":511,"name":"lm","SubTexture":[{"width":137,"y":1,"height":250,"name":"arm_r","x":237},{"frameY":-1,"y":1,"frameWidth":114,"frameX":-1,"frameHeight":394,"width":112,"height":392,"name":"leg","x":1},
and so on and so forth.
all of the Atlas files and images have the same name and are in the same folder, nothing is encrypted or compressed.
I was wondering if someone could help me by writing a script that could take this atlas file and cut up the PNG into separate PNG's.
I will include a sample.
It wouldn't let me upload a json or txt so I had to rar it. this includes the json and png sample.
Any help on this would be very appreciated, other wise i have to do this by hand, and for some of the later PNG's that's impossible.