Real GBA and DS-Phat colors

I made a conversion list for developers who are implementing color correction to their software. This is specifically about how the GBA-Color shaders or Color-Mangler shader performs. Most of the color shaders are based on Color-Mangler shader.

The top one shows how it’s converted correctly. The conversion is explained.

Color-Mangler has multiple conversions.

First, it changes the gamma to 2.2 on the image, so it is darker. It is from Target_Gamma command that darkens it.

Then, we have the color values, RGB ones, luminance, saturation, and contrast applied before reversing the gamma on the next step. It is set on a dark image from the first step.

Finally, we have Display_Gamma command that does the gamma conversion on the processed image. It does reverse the gamma, so it does divide 1 with whatever the number it is set on Display_Gamma, like 2.2. (1/2.2) = 0.4545…

This is a similar process that the .icc profiles do on applications to have correct brightness on the colors with color correction on the image. As you can see on the final image, the color primaries have better luma levels. As you can see on the final and right image, that’s how the GBA looks when I used the actual hardware.

So here are the wrong process ones:

  1. On the middle of the photo, it only does color correction with the same RGB values from the shaders above, but without gamma conversion involved. It is the same effect if you set both Target_Gamma and Display_Gamma to 1.0 to not have any gamma conversion.

It causes darker colors overall, and it is more noticable on the primary colors such as pure red, green, and blue. I’ve seen this conversion on apps like Gambatte and Sameboy where the converted colors are darker on colors. The latter has darker greens and yellows, making them more noticably dark. The Zelda image may not look as dark, but that’s because the colors on those snapshots are not originally showing pure RGB colors.

  1. For color conversion, if you want to bring the primary colors to have the exact colors from the correct solution without using gamma conversion, you would have to put different values on each color values to have it exactly on the primary colors only.

However, because of that, along with the lack of gamma conversion, it causes unstable image. It looks too bright that clips through. Also, the greyscale are not grey at all, so colors are all over the place. This is even worse solution overall.

I know by doing color conversion with gamma involved, the color primaries change because it is supposed to look darker on the process in order to look great on the image overall. The gamma conversion is needed to retain both luminance and saturation from the original display to emulate well. .icc profiles does this approach since most displays only have gamma at 2.2, so it is needed.

More info about Color Conversion:

http://www.libpng.org/pub/png/book/chapter10.html

2 Likes

@Pokefan531 Amazing work. The gbc_color shader is incredible. With the right combination of shader passes, like a good LCD grid and a console border, I think it allows for the definitive way to play all GBC games with the best of all worlds, to the point that I probably will never want to go back to any of the real consoles again (I can live without the nostalgic golden sheen of the GBC screen).

For the GBA, however, I am wondering if there could be a better approach, or a more balanced “set and forget” sort of color correction.

What I mean is that the gba_color shader works wonderfully for those obvious cases where the game designers overshot the colors expecting hardware compensation, such as the well known cases of Golden Sun, Wario Land 4, and Castlevania HoD (when I played this game on a backlit GBA I thought Konami was trying to go for really psychedelic colors!). The most general trend seems to be that when designers were aiming for earthy/brown colors (or light blues) the raw colors display a garish yellow (or purple).

But in testing a bunch of games for the past few days I’m noticing that a lot of what “should” be the right colors actually show with the raw colors of a backlit GBA/DS, and the gba_color shader distorts them. I base this “should” on colors used in official artwork, other games in the pertinent series, or colors used on the console from which the game was ported (usually the SNES). The general trend I see here is that, post correction, reds that “should” be a vibrant red become more of a ruby color, what “should” be blue shifts toward cyan, green shifts to teal. Also, in particular, it looks like skin tones are negatively affected, making them too red. Oh, the Capcom logo is another example.

Consider, for example, the Phoenix Wright games, the Metroid games, A Link to the Past, and even Super Mario Bros. Advance 2. Phoenix Wright’s canonical skin tone and blue suit color are distorted post correction, but look correct on backlit consoles. Samus’ yellow suit in Zero Mission as well as her fusion suit appear more accurately when played on a backlit GBA/NDS. The colors in ALttP look almost identical to the SNES colors with the aforementioned consoles (when the lowest brightness setting is used in-game), but very different with the correction shader. Super Mario Bros. Advance 2’s problem actually seems to be simply one of gamma (funnily, this game looks SNES-correct on a DS Lite when the screen is turned downwards about 10 degrees thanks to the inferior viewing angles of this TN screen!).

Even an early DS game like Super Mario 64 DS exemplifies this idea. The colors do look on the garish side when raw/on a backlit console, but they are in fact closer to the original N64 colors than with the nds_color correction shader.

Overall, I am left with the sense that the GBA (and possibly NDS) color shaders are more suitable for a minority of cases rather than for most. Perhaps I’m too greedy in hoping for a one-size-fits-all color shader for the GBA, and surely don’t know enough about color conversion to realize how unfeasible it would be, but I’m still wishing that a more general solution is available to help people move away from the real handheld consoles and their disadvantages without having to second-guess the choice of shader frequently.

My shaders got updated few months ago, but it hasn’t been updated on the repo. I did however do a lot of tweaking with how the colors are supposed to look. It is a bit tricky because to see the correct temperature on the screen with different light temperatures, I had to make the 50% grey color from the screen to set the correct temperature on multiple light source. The lights I have kinda made the whites on the screen to try to reach near 6500k. Although, the blue color is supposed to be a bit bright. The hue seems to be like this on the blue primary color.

As for GBC, I’m getting one to see how the colors actually look. It would take a few weeks to examine it. I want to see if the luminance is actually higher than the GBA. Remember, the gbc-color shader started by Monroe who tried to tweak from the gambatte implentation, with gamma correction and hue colors fixed, and I corrected the color temperature. Just to note that both Gambatte and mGBA (maybe VBA-M), the highest green value is 251.

I’ve played around with the LCD-cgwg-V2 shader. I used my phone that has native 1440p resolution and to take snapshot from my PC. I put several sizes and try to have the closest size to GBA-SP AGS-101 (backlit), and LCD-cgwg is pretty similar to how it looked on my GBA SP. The SP subpixel order is BGR instead of RGB. I did change a few settings on the shader presets in the package long time ago to make the lcd shaders be slightly bright, but I decide to leave the gain and the subpixels the default to see better white shades. I would have the black levels at 0, and gamma to 2.2, since most displays are using gamma 2.2.

Are the most updated shaders the one you linked to here (https://drive.google.com/open?id=0B5KxdoFEcyTkZ3I0WWZkM00zT0k) on your August 9 post?

I replaced the files from the repo with these, and for the gba_color shader I can see a clear improvement! Reds and skin tones in particular look much closer to natural now, and overall colors feel more balanced. I would have had no idea, I just assumed that the repo files were the most up to date! Someone should really push the new files into the repo.

I checked out the updated gbc_color also and I can’t tell as much of a difference, but once again it looks fantastic. In a couple of weeks I should have access to my non-backlit GBC, GBA, and DS consoles and will see with more attention how they compare.

I still feel that for a lot of GBA games in particular the raw colors seen in emulators and backlit consoles are what the game designers really wish could be shown, hoping for the best given what the limited GBA screen was able to display. For those colors, the color correction may be a disadvantage. The problem is when they combined those ideal colors with clearly overdone colors with the limitations of the screen in mind, sometimes overwhelmingly. In any case, for those games where they did the latter to an extraordinary extent, I think nothing will beat playing while using these shaders. I’m really glad someone put in all the work needed to make it available to handheld fans.

Yes.

I think they only updated the gbc-color ones, or it may look similar. To compare the screen and the shaders, it is tricky to see the same exact colorspace. A lot of monitors are aimed on the sRGB colorspace, but most of them are just very close to it. Monitors in a lot of cases aren’t calibrated to 6500k as often, but still looks very close. The screens on the NDS are a bit colder like above 6500k. Also, depending on the light source, the gba and gbc screen needs to be lit that is close to the standard color temperature. The best way I found to compare is to play the game on those screens as often. The eyes would adjust the color temperature on the screen. Also, unlike modern screens, the greyscale is not 100% grey or close to the white temperature of the screen, so it looks a bit colder. I had to use the curve tool on Photoshop to get the best results. This method does the best job at replicating the color temperature that your eyes see when it’s already adjusted. It is best to find a light for non-lit screens that is close to the standard temperature to see better. Just to note that those screens often show the rainbowing effect, especially if you use a flashlight on the screen. Commonly on the first party games, early games was adjusted for the screen, and they pre-calibrated the colors for the screen to see the same visual effect.

One last thing. Not sure if Woozle is available, but my last two posts involved how the colors are adjusted by using the gamma correction, or gamma-to-linear method to adjust colors on the primary so some colors don’t look dark, mainly around the primaries. I’ve seen the post for the Gambatte that added my gbc shader, and showed that it is an alternative to gambatte’s color adjustment. I’ve seen GBA HDMI clips and I want to contact him about the gamma correction method.

More info on gamma correction:

It would be great if you could get in touch with Woozle. He already has implemented color correcting shaders and gamma settings on his GBA consolizer, but shaders on his consolizer and on the Retroarch side stand to gain from some comparison and collaboration. You could try reaching out to him through this twitter account: https://twitter.com/Woozle64

1 Like

The ‘Anime’ comparison screenshot you posted previously, is that a shader, is it possible to download it? I am using RetroArch on Android if that’s compatible…

No. It’s from the actual anime, Mermaid Melody. It’s posted to compare the results.

About a year ago i was trying to get correct colors in Retroarch for GBC and GBA games using your shaders.

GBA games came out looking great (gba-color.glsl + lcd-grid-v2.glsl is basically perfect, fantastic job), but i never found a good combo for GBC (the current results are all waaaaaaay too red). You may find the info that resulted helpful if you are working on the GBC shader:

And for a more current update/condensation:

Youtube capture from a video of someone playing on a real 1998 GBC: https://i.imgur.com/OuDjope.png

VisualBoyAdvance-M with Gameboy Colors: https://i.imgur.com/bUWoPBA.png

Gambatte w/ gbc-color.glsl (Color Correction core option off): https://i.imgur.com/Wws1Ft4.png

Gambatte w/ gbc-color.glsl (Color Correction core option on): https://i.imgur.com/vaonMTJ.png

Gambatte w/ gbc-dev.glsl (Color Correction core option off): https://i.imgur.com/geL3UaW.png

Gambatte w/ gbc-dev.glsl (Color Correction core option on): https://i.imgur.com/T8JpPw8.png

Not sure what type of LCD the reflective screens looks, but lcd-grid-v2 seems to look fine with default settings. I already did my project on a real GBC that I got nearly two months ago and did some research on it. I haven’t finished yet because I need much further tests on it. I also have very few librarys of gameboy games to show full main color primaries. I only got Red and Blue ones, but pur Green isn’t in the color picker from the bootstrap. All I can say now is that the screen is similar to GBA, but the gamma is different. I would explain it as a blog post to show what I mean.

On VBA, the color correction makes the screen have less contrast. On my early days in this forum, most users prefer seeing with full 0-255 range instead of what those internal color correction has looked. The blacks were more grey, and the whites are darker. On GB/GBC, VBA would make the gamma brighter and GBA darker. Also, the red is slightly down, but despite all this, they pretty much looked identical to what vba-color shader looks.

Both Sameboy and Gambatte’s fast color correction seems to not use gamma correction on the main primaries, which makes those pure colors appear darker than midtone colors. Sameboy pretty much keeps the saturation levels from pure RGB format, only blue is more torqouise. Also, it’s not a good idea to use those shaders with the emulator’s color correction enabled because it makes things more desaturated than it should. With GBC, depending on the light angle, usually above the screen, the gamma is lighter, so the grey ramps are brighter. It can play with how the midtone colors look.

As for my new GBC shader, made from scratch, it is not done yet. I made my own data for the gamma, and checking how the color primaries should look.

Ah. Well i look forward to seeing your new GBC shader in action when you finish it then (:

Great to hear a new GBC shader is in the works.

With what is currently available, what is the best combo of grid shader, color shader, and emulator for the closest picture to the real GBC?

For a long time, I finally have my hands on a real Gameboy Color. I decide to make a blog about it here.

GBC, just like the Gameboy Advance, uses the reflective light LCD instead of emitting light or having a light layer. It was still a big improvement over any original Gameboy and its variants. Like what My Life in Gaming showed on their Gameboy line video, the GBC have better response time and better contrast.

I ordered a GBC and recieved it few months ago and test it myself. The interlaced motion blur is there just like the GBA. The colorspace is similar, but something is really different. When played, the screen looks brighter. However, I flashed the GBC and GBA screen with a room light, and the white color has the same luminance. If both screens have the same brightness on the whites (or screen being turned off), it is related to the gamma. Both My Life in Gaming and the documents of No$GBA and BGB had said that the GBA screen is darker.

http://bgb.bircd.org/pandocs.htm#videodisplay (LCD Color Palettes (CGB Only) Section) https://problemkaputt.de/gbatek.htm#gbalcdvideocontroller (LCD Color Palettes Section)

It’s true that the gamma is darker, but the GBC is lighter. It is the opposite of how the GBA screen’s gamma worked. When you flash the light on the GBA, it depends on the angle of the light that is hitting the screen. When you have the light flashed on the bottom angle, it is really close to a standard gamma. If the light is shot at the middle 90 degree angle, the gamma has changed, and the GBA looks a bit darker when playing a game. On the middle angle, the dark areas are still seen pretty well. On the GBC, it becomes a bit brighter. When the light is going really above, such as having the sun or a light from the roof, the gamma shows a bigger difference. The GBA is darker that it’s sometimes hard to see dark areas, but the GBC looks brighter, but still can see all the highlights fine, and the dark areas are really bright. It’s really weird that GBC and GBA work in different ways. GB or GBC games looks fine on GBC. Some developers know that GBA is darker, even being different than the GBC.

Games like Shantae or Legend of Zelda Oracles of Age & Season have palettes for GBA. Those palettes looks like they have brighter gamma, just to have the palettes optimized for GBA. Later on in the lifespan, those games may look too bright when played on a Gameboy SP (AGS-101 backlit) or Gameboy Player.

It’s really odd that they made GBA’s screen work differently on gamma. It’s no wonder why the screen is known to look dark. It’s also the reason why developers didn’t need to worry about their games to look dark on GBC. However, the color space is different from most TVs and Monitors. It is less saturated, just like GBA. The colorspace is similar to GBA, but slightly different. As far as I have been trying to sample the colors to the screen, GBA seems to have slightly more saturation. Brighter gamma seems to make other colors brighter with less saturation, while the GBA is reverse. That’s how changing the gamma setting works. There is no real gamma value for each screens since it varies by light angle, but I can give the best values to show the best matched gamma when having the light from the top, the middle, and the bottom angles.

GBC-Color option has brightness values from 0 to 1.2. Top: 1.2 Mid: 0.5 Bottom: 0.0

GBA-Color option has darken values from -0.25 to 1.5. Top: 1.5 Mid: 0.45 Bottom: -0.25

When trying to flash the bottom on GBA, the gamma seems to be a little bit brighter than how the gamma is shown on emulators. It’s odd that the GBA gets the reverse effect of gamma variance from GBC, but it can have slightly brighter gamma than standard gamma if the light is shooting from the most bottom angle. If done on GBC, it doesn’t look dark, but it can have slightly brighter on the gamma, but since shoving the light on the bottom is more difficult due to its handheld design, I couldn’t determine the darkest gamma that I can recieve at best. However, the GBC can look close to Gamma 2.2, which can mean that the brightness can be set to 0.0 value if you prefer raw gamma. For the middle angle values, I don’t set the value to 50%, but around 30-40% on the strength. I tried matching them with the screen when trying to shoot the light in the middle angle.

I am aware that there are GBA games that do have different video setting when played on Gameboy Player. Games such as Super Mario Bros 3 have the palettes match the SNES Super Star game. Only thing I saw different in standard GBA mode is a simple gamma boost instead of also converting sRGB colors to GBA. Doom has only gamma adjustment, just like the actual original DOS game. Legend of Zelda games do have brightness adjustment, where the lowest one matches the SNES games. There are several more examples of GBA games that either has Gameboy Player enhancement to the video or have internal setting for the brightness. Sonic Advance 3 Gameboy Player mode looks a bit washout.

In the end, GBC shader looks really identical to the screen. Palettes matches more often between the screen and the shader. Of course, like GBA shader, GBC shader is also more or less absolute on colorspace. The blue is supposed to be more blue, but most screens target sRGB colorspace and the blue color found on GBC, GBA, NDS, or PSP cannot be completely replicated. The shades around the blue primary are pretty much clipped on the red value to have the other color tones match better. That’s how colorspace work when using icc profiles in relative or absolute mode.

(Bonus) On GBC bootstrap, if you pick Red/Yellow palette, it will look very identical on both GBC and GBA. How? The Red value is straight up pure red signal and the yellow is a straight up pure red and green signal. You can see it as 255,0,0, and 255,255,0, respectively. Because it is using the full signal on used colors and unused ones with no signal, it is not affected by any variance of the Gamma. That means regardless if you’re using GBC or GBA, and having different light angles shooting at the screen, it will stay the same. Only thing that will change is if how bright of a light shoots the screen, that’s the only thing it matters.

Next subject would be about LCD shaders. Well long time ago, I did play around with the settings for each preset that uses LCD-Grid-V2. I only made the RGB values at 0.75 and have gain at 1.5. It does not change the difference at all when comparing the default settings that has RGB values and Gain at 1.0. I was trying to see how I can have LCD shaders look bright enough without having clipping on the whites or looking too dark. Of course, it looks best when turning up the brightness of the screen. Well, that’s the only best option until majority of the users have HDR screens. Besides that, the Gamma has to be at 2.2 with Black Level and Ambient at 0.

Each handheld consoles have different RGB patterns. Some are RGB and others are BGR. Based on the consoles that I have, it’s best to look at an image that has very high contrast, like black and white to see what type of order the LCD is. Here are the lists:

GBC: RGB GBA: BGR SP-101: BGR NDS: RGB DS-Lite: BGR

I would like to include the PSP and old Palm phones in the list, but I don’t have those, and the latter have many models of it. To tell how the screen is RGB or BGR order, Have the white be the major part on the screen and look at the edge of the blacks or the sides. If the right edge of the screen is red and the left side is blue, then it is BGR. Same can be said for BGR if Blue and Red are reversed. I decide to change the settings on the preset based on the console’s screen.

The screens on GBC and GBA doesn’t look like it is interlaced like you would on a raw unfiltered interlaced content straight from a DVD. Instead, it looks like it has some sort of scanline motion blur. When moving up and down, depending on the speed, I can see some jagged edges, and even having a static image, you can see some scanline flickering on midtone colors or even grey. On NDS, all you only see is minor scanline motion blur. The PSP 1000 and 2000 has the longest response time I’ve ever seen on a portable device, the last time I saw it.

Now the last thing is to suggest which is the best LCD shader to use for GBC, GBA, and NDS. What’s best in my eyes that comes the closest is the LCD-Grid-V2 shader. I’ve tried the AGS and AGB shaders, but the subpixels are too thin and it looks a bit more dark than LCD-Grid. Sameboy or Simpletex shaders aren’t that close either. The white can pretty much reach above RGB just like normal screens. I’ve taken the snapshot of LCD shader to my phone that is 1440p, and compare it with my GBA-SP 101. It seems to look very similar on how the LCD shader looks. I even check on my GBC and it seems to match the shader providing that I use RGB order with GBC shaders on the top.

Best setup to emulate the screen is in this order: “LCD-Grid-V2 + GBC-Color” If you want to add motion blur, it goes like this: “Motion Blur + LCD-Grid-V2 + GBC-Color” Or course, you can change a specified colorspace from GBC to a different one, or not use it if you want to see pure raw colors like you would on AGS-101. The motion blur has to be first since it looks at the raw image only.

Now that I’m finished on the blog about the LCD screens from the real hardware of GBC, GBA, and others, here is the release for the shaders.

https://drive.google.com/open?id=0B5KxdoFEcyTkZ3I0WWZkM00zT0k

Soon: Shaders for BT.2020 and DCI-P3, for phones and Windows 10 HDR mode. Wider colorspace can show the blue color more accurately.

6 Likes

Updated the link. Default value for GBC-Color on CG and GLSL matches the slang version now. Both GBA and GBC have the default value at 0.5 for Darken Strength and Brighten Strength, respectively.

1 Like

Incredible work again. I’m really fascinated by the screens and colors of the GBC and GBA, but lack the knowledge and dedication to do even a fraction of this. Your research and shader production and recommendations are of so much value. Thank you.

By the way, have you ever played around with a GBA Micro? To me it feels like Nintendo’s take on what the original GBA colors (as opposed to those of the AGA-101) should look like when combined with a backlit screen. It’s too bad GBC games are not supported by the Micro, but there is a way to get an idea of what they would look like on this screen and its colors by using the Goomba emulator on a Everdrive GBA X5 flash cart.

I don’t have it. It seems pretty expensive since it’s a rare console. Maybe someone who has it can use 240P test suite on the flashcart to show the Red, Green, and Blue color to collect the colorspace with a colorimeter like Colormunki Display or X1.

Good Day, sorry for not creating a new thread, but I’am a new user and not allowed to…

I’m not sure if this attempt is already been tested, but what if you take a game, where you know for sure, they had something in mind as they created the palettes; maybe all dark colours have the same lightness and saturation just the hue different. Or all light colors are a x steps lighter shade of a dark color. So we hope we find or know a game where they created a color palette with math to match on the used display. A shader how claims to be correct would show the indented art style in the new palette.

(Maybe should use optical lightness and saturation as the devs probably had no tool and could only adjust via eye)

*edit okay, the following may be a long strech but: I have seen this images:

https…byuu.net/images/video/color-emulation/7.png

https…byuu.net/images/video/color-emulation/8.png

And I imidently thought, hey, I know this (second) palette! Its the Pokemon spaceworld demo pal! Well kinda, but the idea sticked to me so I decompressed the colours from the dissasembly project ( (x*255)/31 ) of pokemon gold and spaceworld demo:

color1 left: spaceworld; right: gold

Hmm, Okay lets come to my ‘crazy’ idea: The colours are from the spaceworld demo, before the GBC, so you think they took the only available colors they had, the SGB colours, but these are not SGB colours, not for pkmn, they had from green to yellow all a very pale palette, getting even brighter with yellow. And it’s odd that they match so perfectly with shaders trying to recreate the gbc colors. I think these colours on the left are gamefreaks unprocessed colors before they do the math/magic to convert them to a new palette. Like you see on the right with golds SGB colours. And here:

(can only have one image linked… sigh…) (will come later)

  • https…i.ibb.co/ScXswJd/color2.png

The only left overs I could find in gold that matches position inside the rom (left: spaceworld; right: gold) ( I stripped white and black, as they are the same as above) I think these colours are the result of another magic spell converting the spaceworld colours to GBC ready colours

This sounds like something torridgristle worked on awhile back, where he compared the same pokemon sprites on GBC and GBA (so you’ll also want a GBA color shader in there with it):

Thank you! Does torridgristle have a thread where he talks about this? But this would be a shader for a compromise between gbc and gba?

As for now, I search for a game where I/people know that there is an intended style in the palette, so I/we can work with that

atm I put together a ‘new’ gamma correction that should work with the most consoles

(its very subtile and need different tables per console)

Quick=(raw color + colorspace table > corrected gamma and slightly adjusted colorspace)

Here you can find an ‘interactive’ demo, because I have no idea how to program a shader (Credit: Pokefan531, JamesF, torridgristle)

These functions can handle color tables for color corrections / simulating of displays, but normaly should only use small values to counter color-space of the hardware (if you want color correction add a addtional conversion)

You can set the Gamma input and output in 0.1 steps, higer or lower, if you can’t see a differents in the picture above

1 Like