Image deduplication of flipped/mirrored frames?

Discussion and feedback on Construct 2

Post » Fri Jun 21, 2013 3:42 pm

The very cool image Deduplication of sprites was introduced in r133.

Yesterday, I was testing and playing with it for another reason when I noticed that frames of a sprite that are *exact* mirroring or flipping of another frame are still included as a separate and unique frame in the generated spritesheet.

I am curious if there is a specific reason for this (as deduplication algorithms normally also look for these in order reduce the size of the resulting spritesheet even more) or this may get implemented in the future.

Once again, thanks a lot for this feature.
B
19
S
4
G
4
Posts: 71
Reputation: 3,913

Post » Fri Jun 21, 2013 4:38 pm

The main reason is we have to change the rendering logic to deduplicate mirrored/flipped versions of frames, which makes it a little more complicated than just sharing an image between multiple objects (it has to become a reference to an image, plus a transformation to apply to it). The transformation has to work in both renderers (and I'm not sure off the top of my head if canvas2D can do that straightforwardly). We could add other transformation checks like simple rotations, but that adds further complication. Usually most features are a trade-off to maximise both straightforward engineering (which isn't too time consuming) plus utility to end users. I think this is a case where we've achieved most of the utility with the minimum of complexity.
Scirra Founder
B
381
S
222
G
84
Posts: 23,980
Reputation: 189,190

Post » Fri Jun 21, 2013 5:23 pm

Yeah, I guess it is always more complicated than it looks from the outside.

Rotation and zooming have the added complexity that they are not "perfect" transformations as pixel artifacts may appear (which is not the case with simple flipping/mirroring).

In any case, thanks for the info and for this feature
B
19
S
4
G
4
Posts: 71
Reputation: 3,913


Return to Construct 2 General

Who is online

Users browsing this forum: tetuan and 7 guests