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.

DarkBASIC Discussion / Changing Transparency Color

Author
Message
SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 8th Dec 2002 23:41
I have a sprite which is includes a lot of black, so I can't use that as the transparent color, so I chose purple. But I can't find a command to change the transparent color (like the set colorkey command in dbpro). If there is no such command what am I supposed to do... decide I can't use a certain color for my sprite (insane)?
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 9th Dec 2002 00:15
I thought the command was just colorkey
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 9th Dec 2002 00:23
Set Image Colorkey is the command you looking for, but make sure you use it in the right place, it's best called before you load your sprite images.

"Earth is the cradle of humanity,
but one cannot live in a cradle forever"
Konstantin E. Tsiolkovsky (1911)
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 9th Dec 2002 00:26
...oh! That's providing of course you're using DBPro, if not, then sorry, can't help you im afraid.

"Earth is the cradle of humanity,
but one cannot live in a cradle forever"
Konstantin E. Tsiolkovsky (1911)
SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 9th Dec 2002 02:51
Notice I mentioned, I already know of the colorkey command in DBPP... but I have DB 1.13

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th Dec 2002 02:55
DB is the range from rgb(0,0,0) to rgb(15,15,15)

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th Dec 2002 04:02
and not to mention the "set object" command to activate it

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th Dec 2002 04:56
sorry my mistake
DB is the range from rgb(0,0,0) to rgb(4,4,4)

in 16 bit mode

SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 10th Dec 2002 02:43
What I wanted to know is how I can change it so the color made transparent on my 2D sprite is purple. Anybody got an answer?

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Dec 2002 03:57
I dont think there is a way to alter it in DB 1.

SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 10th Dec 2002 07:03
Whadda stupid game langauge... don't see why anyone would buy such an unpowerful excuse for a games creator

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Dec 2002 07:54
oh riiet...

xxxpetratxxx
B. R. W
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Dec 2002 08:11
whats wrong with using black rgb(0,0,0)?

Manson
21
Years of Service
User Offline
Joined: 20th Oct 2002
Location: Denmark
Posted: 10th Dec 2002 14:54
Sounds like you're working with something like the tiles from Duke Nukem 3D,,, or an other build based game,,,
Anyway, I've run into the same problem.
What I did was to change the black color to an other color very near to black, and then change the purple to black.

This can be done using DB, by making the program search through the image, and then automaticly change the colors.

Images using purpel as the transparent color are mostly 256-color-based, which allows you to use my method with no loss of visual quality

actarus
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: 32 Light Years away
Posted: 10th Dec 2002 15:04
Why would u want to buy DBC,I mean,get the pro now or wait some issues to be settled and play with the demo in the meanwhile...geez

Just remember that you're standing on a planet that's evolving
And revolving at nine hundred miles an hour!
SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 11th Dec 2002 01:59
indi: my sprite is rendered from a 3D model...
Manson: Interesting plan... maybe I'll try that if turning the lighting up doesn't work.
arctarus: It doesn't seem you realize I already have DBC, and I'm getting DBP as soon as possible.

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Dec 2002 02:19
sneaky u could always change the render back ground b4 render, I also have a 3d to 2d render script on my site if u want to use it.

turn off anti aliasing when doing grabs.

SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 11th Dec 2002 04:12
I did change the render background (to purple), but my character is almost entirely black.

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Dec 2002 06:55
SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 11th Dec 2002 17:32
Here ya go...


indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Dec 2002 18:08
thats a jpeg which means its lossy and isnt the best thing for me to start with.

got a bmp or something without lossy compression.??


Ill have a look anyway, but if u have the higher res one I can see it clearly

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Dec 2002 18:12
also what make the final 2d image with.

SneakyPeach
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location:
Posted: 12th Dec 2002 02:17
Here's a larger version, in BMP format

http://www.okanaganwebsitecreation.com/front-oversize.bmp

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 12th Dec 2002 02:44
ok if u select the outside magenta with a wand or magic wand tool at a tolerance of zero and anti aliasing off

After u have clicked in the magenta u want to inverse the selection.

Once u have done this the whole 2d character is selected instead of the outside.

from here I would set brightness and record how much then use an eye dropper to check the black levels.

rgb 25,25,25 or rgb 35,35,35 for the black areas as an example in the sprite pixels.

once u have done this inverse the selection again and paint the background with rgb 0,0,0 and no anti aliasing

then save out.

if thats a bit daunting just say and ill post the bmp

Login to post a reply

Server time is: 2024-04-19 02:46:59
Your offset time is: 2024-04-19 02:46:59