Many of you probably have noticed that the YJK color system used by the V9958 screens 10-12 have strong similarities with YUV. Also we now have a lot more CPU power than we had back in the 80's.
Combining those two premisses, I decided to try some of the techniques used to decode YUV/JPG images on the YJK system, and the results were very promising. The color artifacts were almost completely gone, and the number of simultaneous colors increased a lot.
I'm sharing this with you as a kind of Christmas gift, so the following kind of softwares can benefit:
1) MSX image readers/converters: Those tools import MSX images to a PC graphic editor, or convert the MSX image to a format suitable for editing on a PC. By adding this algorithm as an option, you can work with much higher quality images.
2) Emulators. Many emulators make use of some image enhancing algorithms to improve the image quality so it's more acceptable on modern displays. This algorithm may be used by them (and even combined with the other algorithms) to shown a much richer image.
3) FPGA implementations of the V9958, like the OneChipMSX: By adding this enhanced decoder they will be able to show the YJK images using a much more advanced decoder that results in a higher color count.
The algorithm is simple. YJK is very similar to YUV4:1:1. Just as with YUV conversion, you need to add an extra step to compensate for the color subsampling.
1) Read the YJK values as usual, for the group of 4 pixels.
2) Extra step: Apply Lanczos3 interpolation to the J and K values. This will give you the extra chroma information for each pixel, instead of just flat copying the J/K values for the 4 pixels of the group. For real time processing without too much power, you can replace Lanczos3 with linear or cubic interpolation, but the results will be also simpler.
3) Convert the Y and the new *per pixel* JK values to RGB values. You can even use RGB truecolor for this.
Just like YUV, this interpolation doesn't result in lack of perceived sharpness, since it only affects the chroma information. For more information on this topic, read this article. The algorithm can be used for both YJK and YAE (mixed YJK).
I simulated the process on GIMP, and the results shown bellow pretty much speak for themselves. They're zoomed to 2x or 3x to allow you to notice the results better.
First, the Gulliver pin-up by Teruchan. The .SCC file was read using the traditional flat copy of the JK values to the set of 4 pixels. You can notice a lot of color bleeding/blocking, resulting in a horrible jigsaw effects everywhere. Color count= 3830.
Then, the same SCC file being read when decoding the JK colors with Lanczos3 interpolation. All the blocking and jigsaw effects are gone, and the color bleeding is barely noticeable exactly as it happens on YUV and JPG images. Color count= 32847.
For comparison, those are the results when reading the same image by using Cubic and linear interpolation. You can notice that they also achieve much better results than the usual flat color copy, but are also inferior to the awesome results achieved by the Lanczos3 interpolation. This means one must use the best interpolation it CPU affords.
Cubic Interpolation. Color count=29957
Linear Interpolation. Color count=29244
Since the Lanczos3 are incomparably better, the next images will only show the comparison between the flat color copy and the Lanczos3 interpolation.
Haruko pin-up, with chroma information decoded with the traditional flat color copy. Blocks are formed everywhere. Color count=2667
Haruko pin-up, with chroma information decoded with Lanczos3. Smooth backgrounds, blocking is gone. Color count=27803
The classic Lena image, with chroma information decoded with the traditional flat color copy. Notice the horizontal color gradients have very low resolution. There's jigsaw on all curves. Color count=1280.
The classic Lena image, now with chroma information decoded with Lanczos3. Smooth horizontal gradients, blocking is gone. There's no jigsaw on the curves anymore. Color count=18486.
The screen12 opening screen of the game Nyancle Racing. All diagonal lines show jigsawed colors. Notice the cat ears. Color count=2293
The same opening screen, now decoded with Lanczos3. Jigsaws are gone, borders are perfect. Color count=22221.
One of the Quinpl intro screens, with chroma information decoded with the traditional flat color copy. Notice the jigsaw on all red elements. Color count=2836
The same intro screen, now decoded with Lanczos3. Jigsaws are gone, borders are perfect. Color count=28172.