YJK

From HandWiki

YJK[1][2][3] is a proprietary color space implemented by the Yamaha V9958[4][5][6] graphic chip on MSX2+ computers.[7][8] It has the advantage of encoding images by implementing less resolution for color information than for brightness, taking advantage of the human visual systems' lower acuity for color differences.[9] This saves memory, transmission and computing power.

YJK is composed of three components: Y, J and K. Y is similar to luminance (but computed differently), J and K are the chrominance components (representing red and green color differences).

The Y component is a 5-bit unsigned value (0 to 31), specified for each individual pixel. The J and K components are stored together in 6 bits as a complement signed value (-32 to 31) and shared between 4 nearby pixels (4:2:0 chroma sub-sampling).[10][11][12]

The following table shows the encoding of this information across 4 pixels:[10]

YJK bit encoding[10]
Pixel coordinates Bits
7 6 5 4 3 2 1 0
0,0 Y1 K1 low
0,1 Y2 K1 high
1,0 Y3 J1 low
1,1 Y4 J1 high

This arrangement allows for the encoding of 19,268 different colors.[10][11][12] While conceptually similar to YUV, chroma sampling, numerical relationship between the components, and transformation to and from RGB are different in YJK.

Formulas

Original full color image
File:YJK example image.png
YJK converted image

The three component signals are created from an original RGB (red, green and blue) source. The weighted values of

R

,

G

and

B

are added together to produce a single

Y

signal, representing the overall brightness of that pixel. The

J

signal is then created by subtracting the

Y

from the red signal of the original RGB, and then scaling; and

K

by subtracting the

Y

from the green, and then scaling by a different factor.

These formulae approximate the conversion between the RGB color space and YJK:[7]

From RGB to YJK:

Y=B/2+R/4+G/8
J=RY
K=GY

From YJK to RGB:

R=Y+J
G=Y+K
B=(5/4)YJ/2K/4

The Y component of YJK is not true luminance, since the green component has less weight than the blue component.[13] Also, contrary to YUV where chrominance is based on Red-Blue differences, on YJK its calculated based on Red-Green differences.[10]

References

  1. MSX Licensing Corporation (2022). "The YJK screen modes". http://map.grauw.nl/articles/yjk/. 
  2. Niemietz, Ricardo Cancho (2014). Issues on YJK colour model implemented in Yamaha V9958 VDP chip. http://rs.gr8bit.ru/Documentation/Issues-on-YJK-colour-model-implemented-in-Yamaha-V9958-VDP-chip.pdf. 
  3. "VCFe Vortrag vom 2016.04.30 - Homecomputer und Spielkonsolen - Videoarchitekturen als visuelles Medium". http://neil.franklin.ch/Articles/20160430_VCFe_Video_als_Medium.html. 
  4. (in en) IC Master. United Technical Publications. 2001. https://books.google.com/books?id=8RwSAQAAMAAJ&dq=%22Yamaha+V9958%22+-wikipedia&pg=PA3984. 
  5. Martín Sesma, Sergio (2016-10-03). Arqueología informática: los ordenadores MSX en los inicios de la microinformática doméstica (Proyecto/Trabajo fin de carrera/grado thesis). Universitat Politècnica de València. hdl:10251/70909.
  6. Redazione (2008-10-20). "MSX - Vari Costruttori- 1983" (in it-IT). https://www.cyberludus.com/2008/10/msx-vari-costruttori-1983/. 
  7. 7.0 7.1 "V9958 MSX-VIDEO TECHNICAL DATA BOOK". 1988. http://map.grauw.nl/resources/video/yamaha_v9958_ocr.pdf. 
  8. Alex, Wulms (1995). "Schermen op MSX - De 2+ schermen". MSX Computer & Club Magazine (72). http://www.msxarchive.nl/pub/msx/mirrors/hanso/hwdoityourself/msxplus.pdf. 
  9. S. Winkler, C. J. van den Branden Lambrecht, and M. Kunt (2001). "Vision and Video: Models and Applications". in Christian J. van den Branden Lambrecht. Vision models and applications to image and video processing. Springer. p. 209. ISBN 978-0-7923-7422-0. https://books.google.com/books?id=_s2BlAeR66YC&pg=PA209. 
  10. 10.0 10.1 10.2 10.3 10.4 "The YJK screen modes". http://map.grauw.nl/articles/yjk/. 
  11. 11.0 11.1 Silveira, Marcelo (2017). MSX 2+ Colors. http://marmsx.msxall.com/artigos/sc12en.pdf. 
  12. 12.0 12.1 Nunes, Giovanni (8 June 2015). "Edição de imagens num MSX2+/MSX turbo R". https://retropolis.com.br/2015/06/08/edicao-de-imagens-num-msx2msx-turbo-r/. 
  13. Chancho Niemietz, Ricardo (2014). "Issues on YJK colour model implemented in Yamaha V9958 VDP chip". http://rs.gr8bit.ru/Documentation/Issues-on-YJK-colour-model-implemented-in-Yamaha-V9958-VDP-chip.pdf. 

See also