Tag Archives: RGB

RGB displays are more complicated than you think

Nexus_one_screen_microscope

Most people assume that display screens are based on RGB – that is the amount of red, green and blue light emitted is controlled in three signals. We tend to think that there is an RGB ‘value’ at each pixel. However, the reality is a bit more complicated. The picture above is a close up of the sort of display on the Samsung Galaxy S phones, as well as the Nexus One. It is called an RGBG pentile layout. This layout was introduced because our eyes are more sensitive to green light (so green pixels don’t need to be as physically large to appear just as bright to our eyes). However, it means that the ‘pixel’ in a standard AMOLED display consists of 8 colours: RGBG on top of BGRG. Some people claim this leads to less sharp images compared to the standard RGB displays of LCD displays (see below) that are sometimes referred to as real-stripe displays.

LCD-rgb-subpixel-matrix

Some of the AMOLED displays have an RGBW layout, which adds a white subpixel next to the standard RGB subpixels. This allows the display to have an edge in brightness due to a dedicated white subpixel. With that advantage the backlight doesn’t need to be as bright, which saves battery since the backlight is a major user of battery in a mobile device. There is also Samsung’s latest Super AMOLED display technology that has a new subpixel arrangement called the Diamond Pixel. The first phone to use this pentile type was the Galaxy S4. There there are twice as many green subpixels as there are blue and red ones, and the green subpixels are oval and small while the red and blue ones are diamond-shaped and larger (the blue subpixel is slightly larger than the red one).

Displays are much more complicated and varied than you might think. One consequence is that it is not so easy to compare the resolution of different displays technologies beacause they vary in what they call a pixel.

accurate colour on a smartphone or tablet

Electronic displays can vary in their characteristics. Although almost all are based on RGB, in fact the RGB primaries in the display can vary greatly from one manufacturer to another. Colour management is the process of making adjustments to an image so that colour fidelity will be preserved. In conventional displays – desktops and laptops – the way this is achieved is through ICC colour profiles. Colour profiles store information about the colours on a particular device that are produced by RGB values on that device. So to make a display profile you normally need to display some colours on the screen and measure the CIE XYZ values of those colours; you then have the RGB values you used and the XYZ values that resulted. The profiling software can use these corresponding RGB and XYZ values to build a colour profile so that the colour management engine knows how to adjust the RGB values of an image so that the colours are displayed properly. Building a profile often requires specialist colour measurement equipment – though this can often be quite inexpensive now. If you are using your desktop or laptop display and you have never built a profile then you are probably using the default profile that was provided when your display was shipped. The default profile will ensure some level of colour fidelity but particular settings (such as the colour temperature or the gamma) may not be adequately accounted for. If you want accurate colour then you should learn about colour profiling.

It all sounds simple except for the fact that ICC colour profiles are not supported by iOS or Android operating systems on mobile devices. I find this really surprising but that’s how it is for now. Maybe it will be different in the future.

This means that ensuring colour fidelity on a smartphone or tablet is not so straight forward. So what can you do?

Well, there are two commercial solutions to this problem that I am aware of. They are X-rite’s ColorTrue and Datacolor’s SpyderGallery. ColorTrue and SpyderGallery are apps that will use a colour profile and provide good colour fidelity. These are great solutions. Perhaps the only drawback is that the colour correction only applies to images that are viewed from within the app. Having said that, they allow your standard photo album photos to be accessed – but the correction would not apply, for example, to images viewed using your web browser. This is why a proper system implemented at the level of the operating system would be better, in my opinion.

There are two alternatives. The first would be to implement your own colour correction and modify the images offline before sending them to the device. This would not suit everyone – the average consumer who just wanted to look at their photos for example. But it is what I typically do here in the lab if I want to display some accurate colour images on a tablet. But if you were a company and you wanted to display images of some products for example – it might be a reasonable approach. It has the advantage that the colour correction will work when viewed in any app on the device because the colour correction has been applied at the image level rather than the app level. But it does mean you need to do this separately for each device and keep track of which images are paired to each device. This is ok if you have one or a small number of devices but maybe not so good if you have hundreds of devices.

The second alternative would be to build your own app. If you want to do things with your images that you cannot do in ColorTrue or SpyderGallery or if you have lots of devices and you can’t be bothered to manually convert the images for each device, then you could install your own app that implements a colour profile and then does whatever else you want it to do.

On CIE colour-matching functions

In 1931 the CIE used colour-matching experiments by Wright and Guild to recommend the CIE Standard Observer which is a set of colour-matching functions. These are shown below for standard red, green and blue primaries. These show the amounts – known as tristimulus values – of the three primaries (RGB) that on average an observer would use to match one unit of light at each wavelength in the spectrum. Why are these so important? Because they allow the calculation of tristimulus values for any stimulus (that is, any object viewed under any light as long as we know the spectral reflectance factors of the surface and the spectral power of the light).

650px-CIE1931_RGBCMF.svg

I gave a lecture this week about these and so they are fresh on my mind. I wanted to use this blog post to explain two things about the colour-matching functions that may be puzzling you. The first was stimulated after the lecture when one of the students came up to me with a question. You will note that for some of the shorter wavelengths the red tristimulus value is negative. Hopefully you are aware that no matter how carefully we choose the three primaries we cannot match all colours using mixtures of those three in the normal sense. What we have to do is to add one of the primaries to the thing we are trying to match and then match that with an additive mixture of the other two primaries. The question from the student was, wouldn’t that change the colour of the thing that is being matched? The answer is that it would of course. But it’s ok.

We normally represent this matching with an equation:

S ≡ R[R] + G[G] + B[B]

which simply means that the stimulus S is matched by (that is the symbol ≡) R amounts of the R primary, G amounts of the G primary, and B amounts of the B primary. The values R, G and B are the tristimulus values. I put square brackets around the primaries themselves to distinguish them from the amounts or tristimulus values of the primaries being used in the match.

Now when we add one of the primaries to the stimulus (the thing we are matching) itself, we can write this equation:

S + R[R] ≡ G[G] + B[B]

The new colour, S + R[R], can now be matched by an additive mixture of the other two. Hmmmmmm? You may ask. How does that work? Well, we can rearrange this equation to make:

S ≡ -R[R] + G[G] + B[B]

In other words, matching the additive mixture of the original stimulus S and some red with some green and blue, means that – if it were possible – we could match the original stimulus S with the same amount of green and blue and a negative amount of the red. I appreciate that this is mathematical but I hope that it is maths that anyone could understand. It’s not rocket science. Just simple adding and subtracting. This is how we arrive at the colour-matching functions above. No matter what RGB primaries we use one of them will have to be used in negative amounts to match some of the wavelengths. In practice, this is done by adding it to the stimulus as described above. Of course, you may also know that the RGB colour-matching functions were transformed to XYZ colour-matching functions. These are the XYZ values everyone is familiar with. But that is another story I will devote another post to one day.

The second question though, is isn’t this just arbitrary? If we used a different set of RGB primaries wouldn’t we get a different set of colour-matching functions? Again, the answer is yes, but again it doesn’t matter. The whole point about the CIE system was to work out when two different stimuli would match. If two stimuli are matched by using the same amounts of RGB then by definition those two stimuli must themselves match. If we used different RGB primaries the amounts of those tristimulus values would change, of course, but the matching condition would not. Two stimuli that match would also require the same RGB values as each other to match them, not matter what the primaries were (as long as they were fixed of course). So the key achievement of the CIE system was to define when two stimuli would match. However, it was also useful for colour specification or communication but that does indeed depend upon the choice of primaries and requries standardisation.

I hope people find this post useful. Post any questions or comments below.

grab colour – use it

colour pen

Many of you will have seen the Scribble Pen which uses a colour sensor to detect colours. The sensor is embedded at the end of the pen opposite the nib. The pen then mixes the required coloured ink (cyan, magenta, yellow, white and black) for drawing, using small refillable ink cartridges that fit inside its body. The device can hold 100,000 unique colours in its internal memory and can reproduce over 16 million unique colours.

But wait. Don’t think that means you will be able to use the pen to write in 16 million different colours. You won’t. A typical phone screen can display about 16 million unique combinations of RGB (red, green and blue). But many of the RGB combinations are indistinguishable. Open up powerpoint and make two squares. Set the RGB values of one to [10 220 10] and of the other to [10 220 11]. I would be amazed if you could really tell the difference between them. And anyone who has read much of my blog will know that I believe that if two colours look the same then they are the same. So the pen might be able to create 16 million combinations of cyan, magenta, yellow, white, and black – but that doesn’t mean 16 million different colours.

The second problem is that just because your pen can grab a colour (using its sensor) doesn’t mean it can create it. There are lots of colours out there in the world that are outside the colour gamut of an ink-based system (even one using five primaries – cyan, magenta, yellow, white and black).

Read more: http://www.dailymail.co.uk/sciencetech/article-2647129/Forget-crayons-Multicolour-pen-lets-pick-colour-draw-16-million-shades.html#ixzz35gJ0racJ
Follow us: @MailOnline on Twitter | DailyMail on Facebook

colour correction for iphone

colour correction for iphone

Of course, one of the reasons (but by far not the only one) that the iphone has been so successful is the quality of the camera that is built in. It was certainly one of the features that made me switch from Nokia about 3 years ago after more than 15 years of loyalty to the swedish brand. So I was interested to read recently that the next iphone may feature advanced colour correction methods and promises to be even better than its predecessors. You can read about the story here.

Colour correction is necessary because different cameras use different RGB primaries and because the activation of the RGB sensors when taking an image depend upon the quantity and quality of the ambient illumination. So, for example, imagine the light was very very red, then the R channel of the camera would be more strongly activated than if the light was whiter. However, our visual systems are able to compensate for this so that most of the time we don’t notice objects changing colour when we move from one room to another or from inside to outside. Colour correction is inspired by human colour constancy and attempt to correct the images so that the objects in the scene would retain their daylight appearance. However, colour correction is difficult; that is, it is very difficult to get it right all of the time. One frustration I have is taking a photo of my band (I play drums in a covers band) under very colourful lighting. Often the images are very disappointing and lack the intensity of the original scene. That is because, human colour constancy is only partial and under extreme lighting things really do change colour markedly – such as under our intense LED stage lighting. In these cases I think sometimes the automatic colour correction is actually too much and I have found that I have to modify the images I capture on my mac to try to recreate what I think the original scene looked like. So auto colour correction – the state of the art – is certainly not perfect. Let’s hope this story about an advance made by Apple is true.

race for colour

Over the summer I was asked to take part in a BBC documentary about the recent discovery of the first colour movie film that was fond at the National Media Museum (Bradford). I met the presenter Antonia Quirke (who was very nice) and we filmed for half a day. In the end only a few minutes of our footage made the final cut. Still it was nice to be on TV and BBC1 at that!! For further details see here.

Race for colour

The films were made by a young British photographer and inventor called Edward Turner, a pioneer who can now lay claim to being the father of moving colour film, well before the pioneers of Technicolor.

The footage will be shown to the public from 13 September at the museum in Bradford. And a BBC documentary, The Race for Colour, will be broadcast on 17 September in the Yorkshire and south-east regions on BBC1. I will feature in the film for a minute or two. Exciting.

For further details see the story in the Guardian.

colour management for beginners

Colour displays are now affordable and enjoyed by consumers at work, at home, on mobile displays and in cinemas. Consumers often take it for granted that there is good colour fidelity as images are transferred between different devices. So, for example, a red object in an image appears to be approximately the same red when the image is displayed on different computer displays, when it is printed, and when it is viewed on a mobile phone.

This colour fidelity is not easy to achieve. Different devices use very different technology to display colour images. For example, a computer display will mix together light from three primaries (red, green and blue) to generate a range (gamut) of colours. On the other hand, a printer uses completely different technology and typically uses mixtures of cyan, magenta, yellow and black inks to create the gamut of colours. Even computer monitors use a variety of different technologies (from CRT displays, which are becoming obsolete, to LCD, LED, and plasma technologies) each of which may use quite different red, green and blue primaries. Colour management is required to compensate for differences between the technologies (colour primaries, colour mixing, colour gamuts) between different image-display devices. This necessitates that the companies that produce image-display devices must cooperate so that the devices are able to talk to each other; this is achieved through the International Color Consortium (ICC) . The ICC is an industry consortium that was established in 1993 by eight industry vendors (including Microsoft and Apple). Today approximately 70 companies are members of the ICC whose goals are to “create, promote and encourage evolution of an open, vendor-neutral, cross-platform colour management system architecture and components”. The ICC system is implemented in terms of device profiles and colour management system. The device profile is a computer file that is associated with each device (printer, camera, monitor, etc.) that essentially contains information to allow colour to be managed. In the case of a computer monitor, for example, the device profile would include information about the monitor’s primaries that would allow the colour image to be adjusted to compensate for the properties of the monitor so that the colours are displayed correctly. The colour management system is software that manages how these device profiles interact with each other and is normally part of the operating system of the computer.

Thus, when users capture, view, or print images they are using colour management all the time even though they may be unaware of it. Though this level of colour management is built into software and device drivers and is broadly invisible to the user it does enable colour consistency for images when they are captured, viewed and printed throughout the world. However, this level of default colour management is far from perfect. It does not, for example, generally account for changes in settings for a device (for example, a user may change the contrast, brightness, or colour temperature of a display) so that colour fidelity is, in practice, only approximate. This level of colour fidelity is probably sufficient to satisfy about 90% or more of consumers for whom colour is not a critical issue. However, for professionals working in industries where colour is a major concern (e.g. design, retailing) a higher level of colour management is often required. For these users, it is possible to obtain systems (typically low-cost colour-measurement devices and associated software) that allow a user-defined profile to be generated for a particular device with particular settings. This user-defined profile then over-rides the default profile and should enable a better level of colour fidelity to be achieved. Nevertheless, colour fidelity is always likely to be an imperfect issue. It is difficult for colour-management systems to perfectly compensate for the fact that, for example, different devices may generate quite different colour gamuts (typically, the bright red on a computer screen cannot be achieved by a CMYK consumer-level printer).

For ICC see www.color.org