Simulating 16-bit (65536) colour in Photoshop

A task recently came up which required graphic assets in 16-bit RGB 565 format to work with some old legacy embedded hardware. In case you’re not familiar with the terminology, 565 basically refers to the number of bits used to store each colour channel; 5 for the Red and Blue channels, and 6 for the Green channel.

The reason for the unbalanced distribution of bits is that packing a pixel into 15 bits is inefficient since pixels don’t align on byte boundaries, so an extra bit is added in order to make each pixel byte-aligned. This additional bit is sometimes just wasted (xRGB 1555), sometimes used to provide a basic boolean opacity mask (ARGB 1555) and sometimes added to the green channel (RGB 565) since the photoreceptor cells in the human eye are more sensitive to the yellowish-green part of the spectrum.

The BMP file format supports 565 mode natively, but having to repeatedly save the design in order to preview the loss in resolution was a pretty poor workflow, so I came up with a reasonable way to simulate it live – It’s not pixel-perfect to what the Bitmap export module produces, but it’s pretty close.

This technique makes use of the Posterise adjustment layer, which simply clamps input values to a predefined number of levels. The Red and Blue channels are stored in 5-bits each which results in a maximum of 32 distinct values (25), whilst the Green channel gets its extra bit which doubles it’s possible values to 64 (26.)

Photoshop Advanced Layer Blending
Locking the first Posterise filter to Red and Blue channels

By default the Posterise adjustment layers work across all channels equally, but by tweaking the advanced blending models of the layer it can be targeted on operate only on specific channels.

These controls can be found in the Blending options for the layer.


The trick therefore is to use 2 Posterise filters; the first should be set to 32 levels and set to operate on the Red and Blue channels, the second should be set to 64 levels and set to operate only on the Green channel.

Grouped posterise adjustment layers
The two posterise filters work in parallel to filter the channels separately

Grouping the two adjustment layers together effectively creates a custom togglable effect, which makes it easy to view either the original artwork or the simulated result by switching the visibility of the group.


Here’s the results of the preview against a basic test pattern:

RGB888
Original test image
555Bitmap
RGB555 Bitmap
555Preview
RGB555 Preview
565Bitmap
RGB565 Bitmap
565Preview
RGB565 Preview

Here’s a side-by-side comparison of an enlarged segment of the test images which makes it easier to see the results:

Comparison
Side by side comparison of the different modes

The slight difference in the output is most likely down to rounding methods; by the looks of it, the Bitmap output module rounds to the nearest integer where as the Posterise filter rounds up, but it’s a near enough approximation.

You can grab the 16-bit preview PSD, which contains both the RGB555 and RGB565 previews.

Join the Conversation

5 Comments

  1. Hello sir,
    i just wanted to thank you very very much for that solution. I’m designing app for LCD that supports only 16bit palette and finally i can preview my work easly 🙂

    All the best,
    Darek.

  2. Thank you very much for your efforts! Helped me a lot! I too am preparing design for 16-bit screen.

  3. This is brilliant and exactly what I was looking for. Was having a very hard time finding anything on google relating to this. I am working on a rockbox theme that requires a 16bit BMP and now I can preview my images without having to save them out over and over again.

    Thank you!

  4. Tried this on Photoshop CC 2018. It is a no-go. Can’t separate into channels – no option for that. Any new ideas?

    1. Sorry, found it. Under blending options. Thanks for sharing this, awesome workflow!

Leave a comment