Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / [DBP U7.4] get image alpha bug

Author
Message
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Oct 2009 18:16 Edited at: 20th Oct 2009 18:17
The get image command does not grab the alpha component from a bitmap correctly.

The following code produces two sets of images with alpha from a bitmap. The first set are produced using the get image command whereas the second are obtained using memblock commands. Both versions grab the colour from bitmap 1. The two sets should be identical.

However, the alpha component of the image produced by the get image version is corrupted. The image produced using memblocks is not corrupt. In each case the RGB channels are correct.

The following screenshot shows the corruption clearly as a black square in the upper left corner of the alpha map.

[Additional tests not detailed here show that the RGB channels are involved with the corruption in some way.]



pcRaider
19
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 21st Oct 2009 16:57
I got a different result.
I attach a file.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Oct 2009 22:19
Quote: "I got a different result."


I'm not surprised. You changed the code. What do you get with my original code?
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Oct 2009 12:21 Edited at: 22nd Oct 2009 12:22
here what I get using the above code, not sure if it supppose to look like it does.



using a Nvidia 7300se card

Dark Physics makes any hot drink go cold.
pcRaider
19
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 22nd Oct 2009 12:48
GG
Do you understand an optional flag of GetImage?
There is it from 0 to 3.
A default is 0.
You choose only one, and it is a color key or alpha.
A color key is stored away as inside information of DBP to an alpha channel.
When you use 0 that is a default, DBP uses a color key.
For example, it .bmp
When you use a color key, an alpha channel is unnecessary.
The alpha channel which is not defined is unknown.

You must use a different optional flag if you need an alpha channel.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Oct 2009 12:49
Quote: "not sure if it supppose to look like it does."


That's what I get when I view the colour channels using the default background colour.

Looks like I accidentally transposed the colour channels when I created the memblock - I'll have to correct that. However, your image shows the problem - the circle is transparent and reveals the background colour but your upper image has the background colour showing through the top left section of the image as well.

The bug is the incorrect alpha - not the transposed colour channels which is very likely my fault .
pcRaider
19
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 22nd Oct 2009 12:56 Edited at: 22nd Oct 2009 12:57
The color key to default is black.
I think that helpfile should explain most more.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Oct 2009 13:03 Edited at: 22nd Oct 2009 13:05
Regarding the transpose, these lines:



should be:



pcRaider

Quote: "GG
Do you understand an optional flag of GetImage?
There is it from 0 to 3.
A default is 0.
You choose only one, and it is a color key or alpha.
A color key is stored away as inside information of DBP to an alpha channel.
When you use 0 that is a default, DBP uses a color key."


Thanks! I completely forgot about the color key which I believe defaults to black. It seems that the bug is rather different from what I first thought. If it uses the color key then you should not get the circle (unless the Help file tells you that will happen) - DBPro seems to give a garbled mixture by default. The Help file doesn't even mention what happens to the alpha channel.

This is still a bug in my opinion. At the very least the Help file should give enough details for us to predict how a command will work.

Quote: "I think that helpfile should explain most more."


Agreed.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Oct 2009 12:47
Quote: "The Help file doesn't even mention what happens to the alpha channel."


Looks like I not only have a faulty memory but also can't read . Here's what the Help file says about the get image texture modes:

Quote: "0-use stretching, filter, colorkey
1-no stretching, no filter, colorkey
2-use stretching, no filter, no colorkey (grab from alpha bitmap retain alpha channel)
3-no stretching, no filter, no colorkey (grab from alpha bitmap retain alpha channel)"


Even with my failing eyesight that suggests I should be using modes 2 or 3.

Please reject this bug.

Login to post a reply

Server time is: 2026-06-11 11:40:00
Your offset time is: 2026-06-11 11:40:00