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.

2D All the way! / Filter for B&W on images?

Author
Message
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 20th Apr 2004 19:26
Hello there.

I know sprites can change RGB color levels, but is there a way to make them be black and white instead of usual color? I'd like some tiles in my game to be B&W instead of color, and I'd hate to have to make separate B&W copies of each image... thanks.
zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 20th Apr 2004 22:38
You can do it in code, but the amount of work required is not worth the effort unless you have some very specific needs.

Basically you would have to copy the image to a memblock, apply some logic to every pixel, save the changes to the image used by that sprite. Perhaps handy if you're doing a animated fade, but not very if you're just working to two images.
--
TAZ

the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 20th Apr 2004 23:46
Attached is a function that will convert an image to greyscale. It proberly isn't very fast so unless you are using small images it might be best to convert all the images at start up. You also need to be running in 32 bit mode.

you ain't the cops
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 21st Apr 2004 08:26
Opps there are typos in that code, use this instead.



you ain't the cops
Peter H
22
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 22nd Apr 2004 18:24 Edited at: 22nd Apr 2004 18:25
uummm...little question that is sort of related (it seemed to small a question too post as a new thread)...is this command safe to use?(as in not extremely slow)
taken from command help in DBPro...
Quote: "FADE BITMAP
This command will fade the contents of a specified Bitmap. You must specify a fade value that sets the
level of fading from zero which fades the bitmap completely to black, up to 100 which does not fade the
bitmap at all. Fade operations are slow and the completion time depends on the size of the bitmap. The
parameters should be specified using integer values.

SYNTAX
FADE BITMAP Bitmap Number,Fade Value
"
i'm thinking of using this like in a intro if i want to fade in\out in a image could i just increase/decrease the fade value slowly to fade in\out a image? or is there a better way...


Formerly known as "DarkWing Duck"
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 22nd Apr 2004 19:22
There are a few ways to fade a bitmap. You could use that command, or just reduce the gamma. Some graphic cards do not allow you to alter the gamma settings, but I think that most of those graphic cards are not used anymore.

the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 22nd Apr 2004 22:40
You could also do it with a sprite using SET SRRITE ALPHA

you ain't the cops
zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 22nd Apr 2004 22:54
That can fade an image to black but not transition or render it in grayscale.
--
TAZ

Peter H
22
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 23rd Apr 2004 00:10
Thanks for the answers! i think what i'll do is use the check "alphablending available" command, and if it's available i'll use "set sprite alpha", but if not i'll use "fade bitmap"


Formerly known as "DarkWing Duck"

Login to post a reply

Server time is: 2026-06-09 13:56:14
Your offset time is: 2026-06-09 13:56:14