Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » JCS & Scripting

16 bit vs 8 bit colour loss

mdnchmr

JCF Member

Joined: Nov 2006

Posts: 6

mdnchmr is doing well so far

Aug 22, 2013, 09:59 AM
mdnchmr is offline
Reply With Quote
16 bit vs 8 bit colour loss

Hello. Why am I losing colours in my tilesets running JJ2 in 16 bit mode?

My tilesets look as intended in 8 bit, but when I run the game in 16 bit I lose colour, as you can see here:

EDIT: WILL LINK ON A REPLY TO THIS POST. Apparently JCF is saying: You are only allowed to post URLs to other sites after you have made 2 posts or more

I`ve tried making two variations of the tileset I finished a few days ago. On the first, I`ve followed the default JJ2 palette. The second, I followed the default JJ2 palette as well BUT checked off the option in JCS for remapping.

I have also tried reducing colours on the tileset itself.

Both still result in the image above. 16 bit mode loses colours.

Especially noticeable on close gradients. The colours in question here are a gradual reduction of 1RGB value each palette slot. Example: "255 255 255 to 254 254 254 to 253 253 253 and so on.

I suspect the colour values are too similar and need more of a gap instead of only going down 1 increment, but thought I`d ask here first instead of revamping my project(yet again )

Thoughts? Ideas? Possible to fix from my side?

Thank you for reading.

Last edited by mdnchmr; Aug 22, 2013 at 10:01 AM. Reason: Typo
mdnchmr

JCF Member

Joined: Nov 2006

Posts: 6

mdnchmr is doing well so far

Aug 22, 2013, 10:00 AM
mdnchmr is offline
Reply With Quote
Post count +1

Link to example picture:
http://tinypic.com/r/w7gf2p/5
Obi1mcd Obi1mcd's Avatar

JCF Member

Joined: Feb 2010

Posts: 692

Obi1mcd is OFF DA CHARTObi1mcd is OFF DA CHARTObi1mcd is OFF DA CHART

Aug 22, 2013, 10:26 AM
Obi1mcd is offline
Reply With Quote
Hm. That's very interesting, I've never noticed that JJ2 does that before. Tried it out myself, and sure enough, same thing. I'm afraid I have no idea why it's doing that, though.
__________________
Define 'normal'.
Torkell Torkell's Avatar

Stealth Admin

Joined: Jul 2004

Posts: 2,153

Torkell is a forum legendTorkell is a forum legendTorkell is a forum legend

Aug 22, 2013, 10:39 AM
Torkell is offline
Reply With Quote
I have a theory...

In 8-bit mode, JJ2 will be using paletted graphics. This gives you only 256 different colours, but the red green and blue values of those colours can each be chosen from the full 0-255 range. So you can do a complete gradient with no banding or artifacts.

In 16-bit mode, JJ2 will be using RGB graphics. However since it's only got 16 bits to play with it'll likely be using RGB565 - this gives a range of 0-32 for red and blue and 0-64 for green. The result is you can't represent a smooth gradient if you have more than 32 steps. Instead the colours will jump in discrete steps which gives the artifacts you saw.

You need at least 24-bit colour (or 32-bit, which in practice is 24-bit with padding) to get the full 0-255 range for each channel, but JJ2 doesn't support that. So unfortuantly your options are to use 8-bit mode or try and design your tileset such that you don't notice the aritfacts.
__________________
-- Torkell



Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,988

Violet CLM has disabled reputation

Aug 22, 2013, 02:14 PM
Violet CLM is offline
Reply With Quote
Torkell is right. 16-bit mode has fewer possible colors overall but allows more unique colors to be on-screen at one time.
__________________
cooba cooba's Avatar

JCF Veteran

Joined: Jan 2004

Posts: 7,812

cooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of lightcooba is a glorious beacon of light

Aug 22, 2013, 02:17 PM
cooba is offline
Reply With Quote
This thread is blowing my mind.
mdnchmr

JCF Member

Joined: Nov 2006

Posts: 6

mdnchmr is doing well so far

Aug 22, 2013, 05:19 PM
mdnchmr is offline
Reply With Quote
Alrighty, those replies solve THAT mystery.

Thank you everyone. Unfortunate, but good to know for future design.
Love & Thunder Love & Thunder's Avatar

JCF Member

Joined: Sep 2011

Posts: 1,101

Love & Thunder has disabled reputation

Aug 23, 2013, 09:09 AM
Love & Thunder is offline
Reply With Quote
Quote:
Originally Posted by Torkell View Post
[...] You need at least 24-bit colour (or 32-bit, which in practice is 24-bit with padding) to get the full 0-255 range for each channel, but JJ2 doesn't support that. [...]
Quote:
Originally Posted by Violet CLM View Post
Torkell is right. 16-bit mode has fewer possible colors overall but allows more unique colors to be on-screen at one time.
Any chance of that being fixed in Plus, or would it be too complicated/unstable?
__________________
burnout92 burnout92's Avatar

JCF Member

Joined: Dec 2012

Posts: 236

burnout92 is doing well so far

Aug 23, 2013, 09:25 AM
burnout92 is offline
Reply With Quote
Quote:
Originally Posted by Robo4900 View Post
Any chance of that being fixed in Plus, or would it be too complicated/unstable?
I think it's could be nice idea but the color loss is a color loss. I guess can't be fixable.
__________________
"Where I walk, I walk alone. Where I fight, I fight alone" Akuma from Street Fighter Alpha The Animation
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,988

Violet CLM has disabled reputation

Aug 23, 2013, 09:41 AM
Violet CLM is offline
Reply With Quote
It would mean recoding basically everything.
__________________
burnout92 burnout92's Avatar

JCF Member

Joined: Dec 2012

Posts: 236

burnout92 is doing well so far

Aug 23, 2013, 09:49 AM
burnout92 is offline
Reply With Quote
Yeah... But we/you are then recode again the whole game...
__________________
"Where I walk, I walk alone. Where I fight, I fight alone" Akuma from Street Fighter Alpha The Animation
Jerrythabest Jerrythabest's Avatar

JCF Member

Joined: Apr 2005

Posts: 2,602

Jerrythabest is a forum legendJerrythabest is a forum legendJerrythabest is a forum legend

Aug 23, 2013, 11:19 AM
Jerrythabest is offline
Reply With Quote
Really interesting findings. I knew it was doing this (since I've seen and played with the code that does this) but I've never actually realised that it would cause this kind of artifacts! Changing it (i.e. to 24+ bits) would require rewriting pretty much all of the drawing code. We've got better things to do.
__________________
Torkell Torkell's Avatar

Stealth Admin

Joined: Jul 2004

Posts: 2,153

Torkell is a forum legendTorkell is a forum legendTorkell is a forum legend

Aug 23, 2013, 01:11 PM
Torkell is offline
Reply With Quote
Quote:
Originally Posted by Jerrythabest View Post
Really interesting findings. I knew it was doing this (since I've seen and played with the code that does this) but I've never actually realised that it would cause this kind of artifacts! Changing it (i.e. to 24+ bits) would require rewriting pretty much all of the drawing code. We've got better things to do.
This is what comes of poking around with various console image formats - you end up playing with all sorts of weird encoding schemes

Interestingly there's some effects that only work well in indexed formats, like the colour cycling you get from touching the smoke rings (which is trivial to do with a palette but hard with any RGB format).
__________________
-- Torkell



Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 05:25 AM.