Scale alpha masked sprite aura problem

Blitz3D Forums/Blitz3D Programming/Scale alpha masked sprite aura problem

Hello,

I am rescaling an alhpa masked sprite and the sprite appears to have a white "aura" around it which gets increasingly noticeable as the sprite grows.

I have tried both using alpha antialised pixels around rounded edges of the sprite as well as "solid and 100% transparent areas" too.

The background is dark, and the edges around the sprite is back too so I don't know what is causing the bright outline. Any ideas?

I have tried both 24bit PNG with transparency as well as TGA.

Thanx
Stefan

It sounds like your pixels are transparent white (0x00ffffff) instead of transparent black (0x00000000). For best results you want to use the transparent version of any neighboring solid pixels.

Where do I set that, in B3D or when I save the image?

(I have only used BPlus and B2 before, so I am new to this, testing some 3D stuff to "rest my eyes" from CTCC at times =)

Thanks

In PhotoShop check your R, G and B channels. If you want to process it in Blitz, use If (ReadPixel(x,y) and 0xff000000)=0 WritePixel(x,y,0).

I'm trying to follow u on this one, but I'll post these images first to make sure we're talking about the same thing.

Here is what the test image looks like as a rescaled sprite with a background:


...here is a zoomed in look at how the alpha is in photoshop:


And here is the PSD file if anything else in terms of transparency needs to be verified:
http://www.imphenzia.com/temp/p1_c.psd

Would this lead to the problem that you are describing? I thought alpha was just alpha, i.e. how visible should this pixel be with the color values R G B.

Thanks again

When graphics hardware multisamples pixels for scaling it does the 4 channels RGBA separately so even if Alpha=0 the RGB from transparent pixels impacts on edge colors.

Photoshop doesn't seem to allow setting of transparent color to anything but white so you need to either start working with 4 channel images or process the images once loaded with that readpixel/writepixel method I explained above.

Maybe you only need to turn off antialias mode in the blending of the pasted Graphics? But anyway: I would work with 32 Bit TGAs in Photoshop - at least in Version 6.

Thanks for the replies

I managed to use the approach that skidracer mentioned with converting it to "black" alpha values. Strangely enough the regions with 100% opacity turned white then?? But I worked around that too by using a black background, and not the fully transparent photoshop option (if that makes any sense).