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 / Just a thought I had...

Author
Message
Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 7th Sep 2009 00:30
I've had no comp,so ive just been thinking about crap that Has to Do With DB.....And well........

My thoughts:

Quote: "

Dbc Users are plagued by the fact that they cant change the Image Colorkey.(at least those whom are into making 2d games..) So, is there a way to get around it. No. But you can work with it. The Default Color key is RGB(0,0,0), or black. If you have an image with pure black in it, your gonna have trouble with DB, most likely. So what do you do?


Well, I personally sit down and change all the Pure Black Pixels to RGB(1,1,1) in paint. That works Just Fine.....But What if youve got say 10 seperate sprite sheets with like, 100 frames of animation on them?..........Its stupid to just sit there and Pixel in every frame thats 0,0,0, sooo.....what if you had good o'll Db do it for you?

What i'm getting at is,(and of course i'd do it, but my comp is dead, so....) What if someone madde a program that you could input the pixel color that you want "Erased", then Replace all those with another, defined by the user as well, and output that to another Image?


"



Sooo, Just throwing an idea out there for someone, I'll be doing it once i get a comp, and heck, i might add in some features no one will see coming.....

So here..... Take The , and......well......Cheers.

-DD

(\__/) HHAHAHAHAHAH!
(O.o ) / WORLD DOMINATION!!!!!!!!!!
(> < )
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 7th Sep 2009 00:56 Edited at: 7th Sep 2009 01:02
In Photoshop you could do 100 frames as a batch file, but I guess that for people without Photoshop it would be nice. If you want to really make a new arty type program I am after a random spaceship texture generator. Just squares overlapped with seams, and bolts etc. I have half made one, but mine still requires Photoshop to finish it off.

Even better if it could recognise a UV map outline, and actually make the metal plates fit around the ship to those outlines.

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Sep 2009 01:02
I think many people have tried this. and if i understand you correctly, you mean to input a image and 2 colors and set all pixels with the value of color 1 to color 2? this in my oppinion even with memblocks would be slow. it could be possible but thats just the way it sounds.

New Site! Check it out \/
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Sep 2009 11:57 Edited at: 7th Sep 2009 11:59
I have some code at home that will do exactly what you want. It is a bit buggy and isn't compatible with every image though... I could post it here, but...

How much will you pay? How much must you suffer to fullfill the ultimate goal of penetrating my defences to scavenge the code from the all-mighty COMET, the lord of code and all that is?

Post it tonight I shall.

(I have been reading too much Lord of the Rings...)

TheComet


Make the paths of your enemies easier with WaypointPro!
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 8th Sep 2009 10:57
Quote: "Post it tonight I shall."


From the sound of that I would say watching too much star wars.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Sep 2009 21:17
Well, here is the code. Credits go to TDK:



Quote: "From the sound of that I would say watching too much star wars."


True, both it might be... Your guess, alas, correct it was.

TheComet


Make the paths of your enemies easier with WaypointPro!
Brick Break
User Banned
Posted: 8th Sep 2009 21:30 Edited at: 8th Sep 2009 22:33
Don't you mean create bitmap 1,640,480?

Anyways, using the code below:


I found that in 16-bit color (DarkBASIC's default), the darkest color at which black is no longer transparent is not rgb(1,1,1) but rgb(5,5,5). Just thought I'd let you know.

WINNER list:
Brick Break, Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Sep 2009 02:16
Clever way to do it brick break.
Would checking the colour in a memblock be quicker?
I struggle with 16bit so I wouldn't be able to make a totally functional version.

TGC Forum - converting error messages into sarcasm since 2002.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Sep 2009 02:49
Quote: "I found that in 16-bit color (DarkBASIC's default), the darkest color at which black is no longer transparent is not rgb(1,1,1) but rgb(5,5,5). Just thought I'd let you know"

Careful BB. The number rgb(5,5,5) is way higher than the minimum transparent black value in 16 bit. It's more around a value of 9 or rgb(0,0,9). Your code is placing c in the R G and B slots at once so it's skewing your results a bit. Here's your code with c just in the blue slot:



Enjoy your day.
Brick Break
User Banned
Posted: 9th Sep 2009 03:51
Wow, I didn't know that! Latch, you never cease to amaze me. Honestly, I thought that would look really weird with the colors being off-balance, but it's not too bad at all, and it doesn't give that little checkerboard effect! It's good to know.

WINNER list:
Brick Break, Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Sep 2009 06:10
Actually though, now that you mention it, it may be closer to black to use rgb(5,5,5) since that is actually a very dark grey as opposed to rgb(0,0,9) which is a very dark blue. I dunno now. I'm starting to agree that rgb(5,5,5) would be a better choice because it is balanced like rgb(0,0,0) .

Enjoy your day.
Brick Break
User Banned
Posted: 9th Sep 2009 06:48
Damn it, why can't 16-bit be in full 32-bit color? Stupid numbers. OK OK so do whatever but don't confuse me please. I think 9 is better because EVEN THOUGH IT SAYS BLUE IT'S NOT! (Let's just say so. I just want to be happy with that, OK?) Wait, this isn't my project, is it?

WINNER list:
Brick Break, Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Sep 2009 19:27
a big advantage of using 9 blue is you wont have to use rgb() or similar calculations that waste time.

TGC Forum - converting error messages into sarcasm since 2002.
Brick Break
User Banned
Posted: 9th Sep 2009 19:43
@OBese- Actually, you can calculate the color values ahead of time anyways. RGB(5,5,5) is the same as [insert number here].

WINNER list:
Brick Break, Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 10th Sep 2009 21:52
Quote: "why can't 16-bit be in full 32-bit color?"


ummmm because it's 16 bit lol that statement is a little contradictive lol

New Site! Check it out \/
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Sep 2009 18:47
I maybe wrong but couldn't you just display the image on the screen then take a screenshot to convert the image to whatever the screens depth is? That would probably make it easier

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 20th Sep 2009 00:12
Cool, rememberd this thread and figured i'd post(I had a go! I think mine is Crap, so i wont bother posting it, it doesn't work!). Could The comet Explain the way his works? and also, um.....well i dont think it quite changes the pixels to a non transparent color.(in the code, i didnt see 'Write'!....lol!)

Will have another go, and b back later!

-DD

(\__/) HHAHAHAHAHAH!
(O.o ) / WORLD DOMINATION!!!!!!!!!!
(> < )
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Sep 2009 09:49
What it does is it opens the bitmap for reading, reads in all of the pixel values, checks which ones are white and saves those into an array so the player can collide on the lines you drew.

You will have to change a few things. The first is here:



This code saves the level to a bitmap. You can remove it actually.



Just change the name of the image you want to cut away the black. Remember, it has to be a 24-bit bitmap.



Just replace the bottom part with this. What it does is it opens a bitmap 1, checks which ones are blue and changes those to black, and writes the read values as color pixels to the bitmap.

You will have to add a save bitmap at the very end of the file.

TheComet


Make the paths of your enemies easier with WaypointPro!
Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 22nd Sep 2009 00:28
ahhh.....okay. thanks, i couldnt quite see.....kk, will try.

(\__/) HHAHAHAHAHAH!
(O.o ) / WORLD DOMINATION!!!!!!!!!!
(> < )

Login to post a reply

Server time is: 2024-05-01 21:14:52
Your offset time is: 2024-05-01 21:14:52