Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Duplicate Images and alias them? #75

Open
jestarray opened this issue Jul 28, 2021 · 0 comments
Open

Detect Duplicate Images and alias them? #75

jestarray opened this issue Jul 28, 2021 · 0 comments

Comments

@jestarray
Copy link
Contributor

TexturePacker https://www.codeandweb.com/texturepacker
has an option to first trim and then detect identical sprites and then only duplicate/alias them in a resulting data file.json which can save a lot of space.

image

{"frames": [
{
	"filename": "1 - Copy.png",
	"frame": {"x":377,"y":83,"w":48,"h":64},
	"rotated": false,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":48,"h":64},
	"sourceSize": {"w":48,"h":64}
},
{
	"filename": "1.png",
	"frame": {"x":377,"y":83,"w":48,"h":64},
	"rotated": false,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":48,"h":64},
	"sourceSize": {"w":48,"h":64}
},
{
	"filename": "2.png",
	"frame": {"x":1,"y":163,"w":128,"h":64},
	"rotated": false,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":128,"h":64},
	"sourceSize": {"w":128,"h":64}
},
{
	"filename": "3.png",
	"frame": {"x":275,"y":83,"w":100,"h":39},
	"rotated": false,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":100,"h":39},
	"sourceSize": {"w":100,"h":39}
},
{
	"filename": "4.png",
	"frame": {"x":131,"y":165,"w":45,"h":159},
	"rotated": true,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":45,"h":159},
	"sourceSize": {"w":45,"h":159}
},
{
	"filename": "5.png",
	"frame": {"x":292,"y":124,"w":82,"h":82},
	"rotated": false,
	"trimmed": true,
	"spriteSourceSize": {"x":9,"y":9,"w":82,"h":82},
	"sourceSize": {"w":100,"h":100}
},
{
	"filename": "6.png",
	"frame": {"x":133,"y":1,"w":160,"h":80},
	"rotated": false,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":160,"h":80},
	"sourceSize": {"w":160,"h":80}
},
{
	"filename": "7.png",
	"frame": {"x":295,"y":1,"w":80,"h":130},
	"rotated": true,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":80,"h":130},
	"sourceSize": {"w":80,"h":130}
},
{
	"filename": "8.png",
	"frame": {"x":1,"y":1,"w":130,"h":160},
	"rotated": false,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":130,"h":160},
	"sourceSize": {"w":130,"h":160}
},
{
	"filename": "9.png",
	"frame": {"x":133,"y":83,"w":80,"h":140},
	"rotated": true,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":80,"h":140},
	"sourceSize": {"w":80,"h":140}
},
{
	"filename": "10.png",
	"frame": {"x":292,"y":208,"w":80,"h":16},
	"rotated": false,
	"trimmed": false,
	"spriteSourceSize": {"x":0,"y":0,"w":80,"h":16},
	"sourceSize": {"w":80,"h":16}
}]}

here are the resulting files:
test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant