Image transparency

Started by krunch, December 05, 2010, 02:21:30 PM

Previous topic - Next topic

krunch

Hi, like other posts on this forum my problem is about image transparency.. I need transparent background in my image, showing the backcolor of the picturebox.

I read this post http://www.opendcl.com/forum/index.php?topic=932.0 but (192 192 192) doesn't work with me, it makes a sort of milky half-transparent mask (white with 50% transparency)..

Did I miss something ?

Fred Tomke

Hi, please have a try with ICO or PNG files with transparent background. Works fine for me in all cases.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

velasquez

Quote from: Fred Tomke on December 05, 2010, 10:50:01 PM
Hi, please have a try with ICO or PNG files with transparent background. Works fine for me in all cases.

Fred

Hello Fred, 
Can you post a test that works with a file PNG with transparent background? 
Thanks 
Velasquez

krunch

Hi Fred, thanks for your answer..

- I tried with .ico (saved-as by MS-Paint, because Photoshop doesn't save this format) but I get the same result..
- As to .png format it's not supported by OpenDCL ?

May be some one could post an example ?
My system is Vista.. does it causes problems ? (...don't know why I would not be surprised...)

Fred Tomke

Hi, krunch, make sure that you're using OpenDCL 6. In this release you can add PNG files to the image folder.
When I tried to create a sample I've found out what krunch meant in his initial post: there seems to be a milky cover over the transparent area.
I didn't notice it before because I usually use backcolor -16 for that (image on top in the sample).

For the case it is a bug I recommend you to add a bug report.

Regards,
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

I think that the picture folder image is stored as a standard bitmap with no transparency information, then the painting code uses color RGB(192,192,192) as a mask to display the bitmap transparently. The fact that the background color is affecting the "transparent" portion of the image surprises me, and indicates that the function is using the alpha channel byte. This must be a Windows thing, because the OpenDCL code doesn't do anything with the alpha channel.

The bottom line is that there are some strange results here that might indicate a bug, but using a bitmap with RGB(192,192,192) and no alpha channel as the "transparent" part of the image should work.

krunch

#6
Yes, apparently image transparency only works with a few BackgroundColor (-1, -16..)

With others the result can be unexpected, not only 'milky cover' : here (below) I just changed BackgroundColors in your previous sample, upper bckcolor -4 makes a pink !

My problem is that I manage PictureBox's background color because it makes sense, and I need to add images with transparent background..

@owenwengerd : when I save-as with Photoshop (.png or .bmp) the alpha channel is disabled

Fred Tomke

Hi, please don't use SaveAs method in Photoshop. There are different places in different Photoshop releases where a special command is placed: in older releases you can find something similar like "Save transparent image" in the Help menu (yes you read correct). In CS5 there is a command "Save for Web" in the file menu.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

Please attach a copy of the .png so I can investigate.

krunch

#9
QuoteHi, please don't use SaveAs method in Photoshop. There are different places in different Photoshop releases where a special command is placed: in older releases you can find something similar like "Save transparent image" in the Help menu (yes you read correct). In CS5 there is a command "Save for Web" in the file menu.
> Thanks, I didn't know 'Save for web' in the Help menu (original!).. I'll think about it. I meant that the image doesn't stock alpha channel

QuotePlease attach a copy of the .png so I can investigate.
> I put back Fred's files ; in the .odcl file I just changed colors as in my last screenshot above.

I could make more samples, just tell..

owenwengerd

I think I have this problem fixed now for the next build.

krunch

Hi, congratulation for your work, and for your reactivity.

I think I found another (minor) display problem with labels.. Does I post here or does I make a bug report for this kind of problem ?

owenwengerd

If you're certain it's a bug, then a bug report is appropriate, otherwise start a new thread here.