texpack
texpack copied to clipboard
Merge identical sprites.
An option to merge identical sprites and not have multiple versions of the same image in atlas would be nice. Identical as in same pixels after trim.
Hello and thank you for the suggestion. I'll take this into consideration, although I wonder... in what situations do you end up packing identical images? Should it also handle cases where images are identical if rotated or flipped?
Maybe identical sprite warnings might be nice? Seems overkill to actually handle that.
I am thinking about animations. In a walkcycle for example i have a char's head bob up and down. The head is it's own sprite. In the final atlas/pack i now have about 20 heads which are all identical pixel-wise, they will just be placed in differently. Detecting (90deg) rotated duplicates would be nice, but simple merge of plain duplicates would be a nice start. And i don't need a warning, i already know that there will be duplicate sprites. There are packers around that offer this feature (eg: https://github.com/scriptum/Cheetah-Texture-Packer) - but i like this one the best so far.
That sounds reasonable enough to me. I can make it handle plain duplicates for a start and then see if rotated/flipped can be added.
@ninnghazad smart thinking!