Resources and Support
 Pixel Joint Forum : The Lounge : Resources and Support
Message Icon Topic: A question about colors Post Reply Post New Topic
Author Message
mr_lou
Seaman
Seaman


Joined: 10 October 2012
Online Status: Offline
Posts: 6
Quote mr_lou Replybullet Topic: A question about colors
    Posted: 10 October 2012 at 11:05pm
A question about colors (from a non-graphics artist).

How do you pick which colors to use when you need to create some artwork for a platform that only offers a limited number of colors?

Is there a standard way of mapping which colors will work?

For example. Let's say you're hired to make some graphics for a game on a platform that only supports 256 colors.
256 colors does not mean it can draw 256 shades of blue. You don't get to pick these colors yourself. So obviously you must arrange your palette so it matches the colors available. But how do you know which colors those are?

I was thinking, the most logical way would be to divide the RGB channels with a factor.

For example, if a platform can show 16.777.216 colors, obviously there can be 256 shades of red, 256 shades of blue and 256 shades of green. 256*256*256 = 16.777.216.
And if a platform can show 4096 colors, there can only be 16 shades of blue, red and green. 16*16*16 = 4096.
But does that mean that you divide 256 with 16 to find which step to use in your RGB palette, so that your color-table becomes something like:
#000000
#000010
#001000
#001010
#100000
...
#f000f0
#f0f000
#f0f0f0

And if a platform can show only 256 colors, we end up with only 6 shades of each channel. 6*6*6 = 216 (also called the websafe colors).

If a platform only offers 256 colors, is it then standard to assume that using the websafe-palette will result in your graphics being shown correctly?

Does anyone usually create pixel art using such a "safe" palette, in order to be sure it'll display properly anywhere?
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 11 August 2024
Online Status: Offline
Posts: 568
Quote DawnBringer Replybullet Posted: 11 October 2012 at 12:10am
You can either have a platform with preset colors or a defined bitspace.

F.ex the 12bit (3*4) Amiga OCS with 4096 possible colors is converted to 24bit not by 256/16 but by 255/15 (=17), as there are 15 steps other after zero, 17*0=0...17*15 = 255.

I'm not sure what you mean about 256 colors and 6 shades. Granted the largest full colorspace possible with 256 (sucky) colors are 6*6*6. But usually you would be able to assign any color to those 256. As with Amiga AGA that has 256 colors that can be picked from a full 24bit palette.

Edited by DawnBringer - 11 October 2012 at 12:10am
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 03 May 2021
Location: France
Online Status: Offline
Posts: 343
Quote yrizoud Replybullet Posted: 11 October 2012 at 2:28am
A uniform 6x6x6 palette may be awkward, it's general-purpose and thus you won't have any freedom of using intermediate color between two that it proposes.
256 colors is tricky because it's too small to "paint" unrestricted, and too large to build an entire palette beforehand and stick to it.
You'd rather build your palette by choosing in advance a series of ranges (connected if possible) that uses for example 60 colors, and then keep the others as a reserve that you use up depending on needs: 10 colors here for text, 5 here for scenery...
Using a program that handles well indexed-colors is mandatory.
Be careful that ALL graphics share the same palette! Scenery and characters seem evident, but don't forget HUD, on-screen text, special effects (explosions, splashes).
If it's your first work with a palette, I even recommend you to make a strict separation: For example colors 0-64 for background, 65-85 for player, 76-96 for enemy1, etc. It will give you less colors in total (because of duplicates) but it will be much easier  to tweak the colors of one character  without altering the others.
If you use such separation, the game can even swap palettes between levels so you can use different colors 0-64 for the different levels graphics, while the characters/UI/effects at color indices 65-255 stay the same.

IP IP Logged
mr_lou
Seaman
Seaman


Joined: 10 October 2012
Online Status: Offline
Posts: 6
Quote mr_lou Replybullet Posted: 11 October 2012 at 6:38am
Judging from your replies, I can see that most platforms seem to allow you to build whatever palette you wish.

I tried a simple experiment on a cellphone some time ago (which is the reason for this thread). Using J2ME code, I displayed a picture, and put some text on top of it. I definitely didn't use more than 32 colors in total. Yet, the picture I displayed didn't look like it was supposed to look.
I concluded it was because the cellphone was limited in number of colors, and that the colors it did have to offer, could be calculated somehow.

Let's say that cellphone could display 4096 colors. That gives us 16 shades of each channel. 16 reds * 16 greens * 16 blue.
That means, if I want to use the 3 darkest possible red shades, I'm stuck with these: #100000, #200000 and #300000
So if I try to use e.g. #140000, the cellphone will automatically change it into #100000.

That's my theory of what was going on. So I thought, maybe graphics artists know about this, and maybe they build their palette for their art from these color-tables for that reason, to make sure their art will display properly on all kinds of devices? But it looks like the answer is a no.

When I look at pixelart at pixeljoint.com frontpage, and aritsts put "13 colors" or "33 colors", I can't help but to think "mkay, but from what color-table?". I'm probably just being silly.


Then it is true of course, that some devices have a preset color-table. The C64 for example. The Amstrad CPC too (although technically the CPC can be categorized as having 3 shades of each channel available).
But as far as I understand, when a device is said to have e.g. 256 colors available - that does not mean you can pick whatever 256 colors you wish. Instead it means you have 256 colors from a color-table to choose your palette from. Is that completely wrong?
If it is true, then logically that color table must be a simple 6-shades-of-each-channel table, right?

When you pick your palette for your art, do you just pick them from "the air", or do you ever use color-tables of some sort?
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 03 May 2021
Location: France
Online Status: Offline
Posts: 343
Quote yrizoud Replybullet Posted: 11 October 2012 at 7:40am
I think your issue was more about 'color profile', and it's completely different from the limit on color count : the white (maximum intensity on all channels) of your cell phone screen is very far from your monitor's white, the black (minimum intensity on all channels) is also different, etc.
It varies from device to device, and their age and settings (brightness, contrast....). It even depends on lighting conditions.
There is no ultimate solution. Professional people use expensive colorimeters to define accurate ICC profiles, and expensive Photoshop and professional screens so that "what they see" on their Mac/PC will be closest as possible to "what they get".

Now for some generalities about the R G B color space: The most frequent issue for screens is to be unable to distinguish dark colors from pure black; and Green makes the biggest difference to the human eye, Blue the smallest. (except to red-green dischromatopians who see blue better than  red)
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 11 August 2024
Online Status: Offline
Posts: 568
Quote DawnBringer Replybullet Posted: 11 October 2012 at 4:04pm
Yes, we pick from a colortable...the one of all the 16.7 million colors that exists ;)

Think you just need to wrap your head around the concept of palette design. A 16 color palette.

Now, if you aim to use a static, full 256 color palette...the easiest thing would be to create a big collage of the kind of art, pictures & colors you want...then let a program (like Photoshop) color-reduce it to 256 indexed colors (ex. Save for Web / PNG-8).
IP IP Logged
mr_lou
Seaman
Seaman


Joined: 10 October 2012
Online Status: Offline
Posts: 6
Quote mr_lou Replybullet Posted: 13 October 2012 at 1:11pm
Yes DawnBringer, it's easy to have a program (like Photoshop) to remap a picture to a certain palette. And most programmers would be fine with that. I don't think the artist would be fine with it though, to have someone else change his work.

Well, all this color-table talk was just a thought. I thought that pixel graphics artists maybe had some color-tables they used to pick their palettes from, but you've made it clear that's not the case. You do not pick you 20-color palette from a 4096-colortable or a limited 216-colortable. Instead you pick from the 16.7 million color-table.

Although I do see pictures on the frontpage where very rough colors are used. For example this:
http://www.pixeljoint.com/pixelart/73442.htm
That one is using 10 colors. If it had used 8 it would actually fit the limitations of the RGB ON/OFF table, where each RGB channel can only be on or off. I thought it might have been an interesting challenge to pixel artists to stick within limitations of such predefined color-tables.

Do you never use any kind of pre-defined palette? You don't have named color-tables? Even if "invented" / created by yourself?
IP IP Logged
mr_lou
Seaman
Seaman


Joined: 10 October 2012
Online Status: Offline
Posts: 6
Quote mr_lou Replybullet Posted: 13 October 2012 at 1:23pm
Picture to show the color-tables I'm thinking about.
http://www.dewfall.dk/colors.png

If you were to pick your palette from the 216-colortable, would you say that would limit your pixel art? Would it make you feel "handicapped", or do you believe you could create just as cool pixelart as if you could pick your palette from the 4096-colortable or even 16.7 million colortable?
IP IP Logged
DawnBringer
Commander
Commander
Avatar

Joined: 11 August 2024
Online Status: Offline
Posts: 568
Quote DawnBringer Replybullet Posted: 13 October 2012 at 3:32pm
The 6*6*6 = 216 Colortable sucks beacuse it essentially only has 6 different brightness-levels, and brightness is key to all good visuals. Furthermore, most of these colors have a very high saturation which is "unnatural", esp. for a large palette.

Of course handpicked colors are superior, how could a human do worse than the most basic and primitive of all methods. Didn't you check the link?

Also like to mention that working with a 4096 colortable can be a good idea, esp. at the start of a palette/image/project, as it gives you colors that are "evenly spaced" and largely prevents redundancies. As you progress and experience need for more specific colors, the bitspace can be expanded.

What is it you are planning exactly, it might help us understand your needs better.
IP IP Logged
mr_lou
Seaman
Seaman


Joined: 10 October 2012
Online Status: Offline
Posts: 6
Quote mr_lou Replybullet Posted: 14 October 2012 at 12:17am
Not planning anything. Just chattin'. Trying to learn more about this.

I was curious to find out whether graphics artists, especially pixel artists, picked their colors from certain color-tables in order to make sure their graphics was displayed correctly everywhere.
I thought that might be a part of the retro-ness in making pixel art. But it seems not. I guess there's no big need to do so. (It seems to be necessary for the cellphones pre-Android though).

The palette example you linked to is a good one. Looks awesome.
I can remap that to the websafe colortable, and me (not being an artist) would be quite happy with the result. Not that I can't see a difference. It just wouldn't bug me the slightest. I am however fairly sure the artist (you) would think "What? That's not what I made!"
So I thought maybe you'd run into situations like that before, and therefor you'd know about certain colortables you could use in order to be "safe", but it seems not.  It's apparently either not a situation that occurs much, or else graphics artists are just fine with it.

But I do sometimes think it would be awesome to have a site like IndieGameMusic.com, except it should be for graphics. And then it would probably be beneficial if there were certain palettes / colortables game-developers could input in their search, to get better chances of the graphics from different artists would match somehow.

IndieGameGraphics.com - would like to see a site like that. Could be awesome. Often thought about starting up that project myself, but first of all I'm way too busy, and 2nd I think it should be done by a graphics artists for best results.

It would require graphics artists to agree on certain palettes / colortables though. I think that 16-color table link you gave me, is an example of one such palette to be used for all sorts of games. It could be given a name by the author, e.g. DawnBringer16a or sumthin', and then used by other pixel artists. (And I find it awesome when graphics like that can be achieved using only 16 colors. That's what pixelgraphics is about in my opinion).

But depending on what platform the game-developer is targeting, there will sometimes be colors the platform can't display. So the device itself will auto-remap the colors to the closest color it CAN display, and then we're back to the "What? That's not what I made!" thought.
In J2ME there's a actually a function that returns the colorcode for the color the device displays, for the simple reason that you can't count on different J2ME devices displaying the same color, despite using the exact same graphics file.

Anyway, it seems that this is maybe only a problem with J2ME devices, which I do find a little bit difficult to believe though. I'm wondering if the Nintendo DS (knowing how great Nintendo is at creating limited devices that can do stunning things) doesn't have similar limited colortable, and likewise with the Gamepark and families.
IP IP Logged
mr_lou
Seaman
Seaman


Joined: 10 October 2012
Online Status: Offline
Posts: 6
Quote mr_lou Replybullet Posted: 15 October 2012 at 11:39am
Alright, I have been driving people crazy asking about this color thingy now.

Here's what I've learned:

You can talk about 3 parts when dealing with colors:
1) The number of colours a device is capable of showing
2) The number of colours it's capable of showing on the screen at the same time
3) The number of colours you have chosen to use

And here is where people like me gets confused:

The number of colours a device is capable of showing is referred to as "the full palette".
The number of colours it can show on the screen at the same time is called "the color lookup table (CLUT)"

If you create a GIF or PNG (indexed colored file) with 16 colors, then it is defined as "a 16 entry CLUT from a 24bit palette".

And that was really what I was looking for: Some way of describing a) how many colors used + b) where the colors came from.

The "16 entry CLUT" is what you would normally refer to as a "16 color palette". (I think all artists does). Turns out, that's actually not an accurate terminology. It's actually a "16 entry color lookup table".

(I'm not expecting anyone to start calling it that).  ;-)
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum