Bug resizing sprites

Started by SSH, Mon 08/05/2006 17:17:02

Previous topic - Next topic

SSH

If I use DynamicSprite.Resize or RawDrawResized and expand a sprite 4x the first and last column and row are all expanded only 2x. If this expected behaviour, it should at least be documented. I worked around it by grabbing an extra pixel around each side, but its a pain!
12

Pumaman

The resize routines are pretty much standard nearest-neighbour affairs, however you can't really rely on an exact implementation of resizing. I don't really think it's something that requires documentation.

SSH

Well, I mean all the pixels around the edge were only 2-pixels wide on 4x resize. One in the middle were all 4x.
12

Kweepa

So you're saying if you resize a 3x3 like this:
Code: ags

123
456
789

You end up with this:
Code: ags

11222233
11222233
44555566
44555566
44555566
44555566
77888899
77888899

I must be misunderstanding. That's not 12x12.
Still waiting for Purity of the Surf II

SSH

yes, butl, i presume that the pixels in the middle are being consequently expanded by more. In your example the widths would be 3 and 6... in my code, I am using larger sprites (e.g. 10x10 expanded to 120x120) where the effect is very visible.

To see the effect, download my walkcycle generator beta http://ssh.me.uk/wcgendemo.zip, press "Head" for example, then click on the head picture to make it appear in the drawing window at the bottom. Thn click the grid icon to make the grid toggle: you can see how I have added a ring of 1 pixel around the edge of the Zoomed picture to avoid the problem, and the grid shows the edges with narrow pixels.
12

Kweepa

Ah yes, I see. So it looks like the nearest neighbour choice starts from the center (or thereabouts) of the edge pixels.
Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk