PDA

View Full Version : Bad Transparency in delphix



seiferalmasy
13-03-2007, 11:22 PM
This follows on from what I said in the past. The transparency of images is pretty awful in delphix. If the image has even the slightest amount of blur and isn't a sharp image there will be HUGE amount of colour still present.

Even if you do use sharp images there is a 1 pixel outline atleast still present.

Surely there is a way around this?

Secondly, can someone tell me the process behind eliminating the transparent colour? I mean, if you select black to be removed, surely the programming is simple to remove all pixels which conform to that colour within a set tolerance?

http://img172.imageshack.us/img172/9818/webghg2.jpg (http://imageshack.us)

<<clearly this is useless, black is still there completely. and same with any other colour i use

Png also have a problem with delphix, if they have transparent alpha channels. It seems to paint a background based on another jpeg/image i have in dximagelist. Bizarre, otherwise just garbles. This is apity because with PNG properly implemented I am sure we could have true transparent images in delphix.

Traveler
14-03-2007, 08:43 AM
Which version are you using? I was under the impression that with ijcro's (http://www.micrel.cz/Dx/) latest undelphix version, it is possible to have such effects. Although I admit, I have not used it for a long while so I could be wrong there.

seiferalmasy
14-03-2007, 12:53 PM
Latest verson:)

wodzu
14-03-2007, 01:58 PM
Indeed ijcro did great job to keep undelphix alive :)

seiferalmasy: I am pretty sure that you cannot setup level of tolerance which will remove the chosen color. The other thing which comes from my experience - use only BMP files for images with transparency. Any other file type might not work (didn't work for me). I don't know maybe ijcro did something with this.

Recently i switched form undelphix to the Asphyre and i must say its features are amazing. Check it out:) You can have full PNG possibilities with many levels of transparency on one image. You can change in real time the colors of your image. Very help full if you have for example a set of units designed in red color and you want it in 10 more colors for different players. Not to mention you have hundreds of FPS on average machine ;)

Regards,

Wodzu

WILL
14-03-2007, 03:36 PM
Look for a function that draws your sprite, but ADDs the image instead of simply drawing and checking for a specific color to cancel out.

You'll get that with any library or graphics API.

ADDing an image means that you are adding the image that is not black. This is how things like particle engines and fireballs and explosions are done.

ijcro
14-03-2007, 04:02 PM
Sorry, I have to see original drawing picture. Please you send me it to my E-mail and after them I can write any advice...

Are some problems with selected transparent color in low colored images but all images (primary used DIB or BMP) converted into texture (DXT) are 24 or 32 bit (32 bit when alphachannel attached).

Regards

seiferalmasy
14-03-2007, 04:11 PM
I will send original picture:)

I also send png too...

i use pngimage pack for delphi, but seems to have problems drawing in delphix. Obviously this is simply a bonus if you can ever get this to work.

Thanks for all comments I will try to add draw too:)

seiferalmasy
14-03-2007, 06:11 PM
Yes DrawAdd get rid of the black, displays colour of blur depending on which colour is in background but I can live with that I suppose:)

ijcro
14-03-2007, 09:11 PM
OK. Please send it directly (when up to 1 MB) to my E-mail, thank you

Robert Kosek
14-03-2007, 09:17 PM
For your information, I have this from Lifepower who did the experimentation and found the problem, the latest pngimage release is flawed and strips or sometimes normalizes the alpha channel. The author is aware of this, but wasn't exactly... cooperative with Lifepower in admitting that it needed to be fixed (it was an apparent security fix, that broke it). Roll back to a prior version and it will work fine.

WILL
14-03-2007, 09:53 PM
Yes DrawAdd get rid of the black, displays colour of blur depending on which colour is in background but I can live with that I suppose:)

Do you know why it does that?

When you ADD an image to a surface it draws it differently then a simple draw function. It literally adds it to the existing color on the surface.

So whats the value of Black? 0, right? R=0,G=0,B=0 is your black color.

So lets say that you have an all red screen for simplicity. (any color or even a complex image will do) If you draw an all black image via ADD you'll not see it.

R = 255 + 0 = 0
G = 0 + 0 = 0
B = 0 + 0 = 0

See whats happening?

You've used a glow effect so anything that is darkened it will have some transparency as if it's alpha channel were less then 255 it's self.

Good stuff you know if you want to get into doing some neat effects later on. ;)

seiferalmasy
14-03-2007, 11:54 PM
Thanks all for explanations and all. I believe I still ha probs with png even in earlier relases though. Anyone got a version that they fee works properly?. Image sent to your inbox ijcro