Charmed Quark Systems, Ltd. - Support Forums and Community
Transparent images in RIVA? - Printable Version

+- Charmed Quark Systems, Ltd. - Support Forums and Community (
+-- Forum: Third Party Development (
+--- Forum: Third Party Development (General) (
+--- Thread: Transparent images in RIVA? (/showthread.php?tid=7019)

Pages: 1 2 3 4

Transparent images in RIVA? - SamVimes2 - 01-11-2011

Hi Dean,

There are some images for which I set a transparent color when I import them into CQC. It seems like that transparency information is not stored in the image itself, but in some kind of metadata in the image repository.

Those images are not displaying correctly in the iOS or Android RIVA clients. Is that meta information transmitted by the RIVA server?


Transparent images in RIVA? - Fonceur - 01-11-2011

In principle, the RIVA protocol does handle transparency. So either it's not sent properly by the server, our clients are not processing it correctly, or the transparency of your images isn't quite standard...

Are you seeing the proper transparency in the IV and the Windows RIVA client?

Transparent images in RIVA? - wuench - 01-11-2011

I have seen some issues with transparency in CQC, I think there was a thread on it waaaay back when. Images look ok in other apps, but transparency is lost on import. I think Dean said it was due to the component he was using for images, it tripped over errors in the image file that most seem to ignore.

Anyway, I usually just open them in an app like mspaint or gimp and resave them, that seems to fix it.

Transparent images in RIVA? - SamVimes2 - 01-11-2011

I think there are two things.
1) Some images have transparency embedded in them (especially .png files?). CQC used to have a problem with some of those, but i think that was fixed. Now CQC/RIVA handles/displays those fine.

2) Some images don't have transparency embedded in them. There is an additional option when you import that let's you specify to CQC "make this color transparent whenever you display this image."

It's this 2nd one that I think is not being treated properly in RIVA. I haven't checked the C++ RIVA client, but Android and iPhone both display them without the specified transparency mask.

Transparent images in RIVA? - Dean Roddey - 01-11-2011

Color based transparency isn't much used these days, so it might have been missed. Give it a quick try in the standard RIVA client and see what happens there. If it's still wrong, then it's probably on the RIVA server side. But it should be sending the transparency color in the call.

Transparent images in RIVA? - Fonceur - 01-11-2011

I don't think I have implemented color based transparency in taRIVA, as I don't think I was able to figure out how to do it...

Transparent images in RIVA? - Dean Roddey - 01-11-2011

It's pretty standard sprite type transparency. It at least traditionally was heavily used in games, but I guess perhaps alpha based images may have completely taken that over these days. But I'd think that most any graphical OS would provide the means to do them still since they are pretty basic graphics type operations.

Transparent images in RIVA? - Fonceur - 01-11-2011

Looking at the code, I can see that for MASKED_ALPHA_BLIT, taRIVA is simply reusing the ALPHA_BLIT code... I actually ignore the c1Flags, and use a paint.setAlpha(c1ConstAlpha). For DrawBitmap, I also ignore c1BmpMode.

So I assume that's why it's not working in taRIVA, or would that be elsewhere? After a quick re-read of the Remote Viewer Guide, I still can't figure out what I'm supposed to do to handle that color based transparency... Wink

Transparent images in RIVA? - brianmount - 01-11-2011

On the iPhone, the system library automatically handles color transparency for me. When the template sends me a file, I just tell the system it's an image, and it seems to figure out the alpha channel, transparent color, or whatever it's using.

The problem is that, for one of the images the template sends me, there actually isn't a transparent color. When I look at what I am sent in my favorite graphics utility, no color is defined as transparent. So of course the iPhone app doesn't draw it with transparency.

Commander Vimes tells me that there is some setting in the interface editor that tells it to define a transparent color for a graphic you have added. But unless the CQC software then takes that transparent color and uses it to generate a modified version of the image, that setting is not going to reach any RIVA clients, because there is nothing in the protocol that indicates a special added transparent color to use in image drawing (I'm not talking about the bit defined for use by clients that don't understand alpha; that's a separate thing that I don't need, because I am able to understand alpha).

Transparent images in RIVA? - Dean Roddey - 01-11-2011

I'll have to look at it tomorrow or later today. Maybe I'm not sending something I should. PNGs can have a transparency color in them, but you should actually be getting a separate one from CQC itself, which is stored outside of the image. The one in the image is a default one if no other is available and you need to display it on a display not capable of alpha transparency. It's not the one you selected when you set a transparency color during import (probably on a JPEG that was imported and then converted to PNG without an alpha channel.)