Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert from RGB565 to 8 bit monochrome

996 views
Skip to first unread message

Stein Kjølstad

unread,
Aug 14, 2003, 7:22:33 AM8/14/03
to
Hi,

how should I convert an image stored in RGB565 (5 bit for red, 6 bit
for green and 5 bit for blue) to an 8 bit monochrome image?

Is RGB2YUV conversion possible storing the intensity values only?

Thanks

Stein Kjølstad

samourai

unread,
Aug 14, 2003, 5:37:27 PM8/14/03
to
hi,

it will depend somehow on what you expect to do with the result.
additionnaly, I am not sure that '8 bit monochrome' exists. It should be
'1 bit monochrome (b&w)' or '256 grey scales'

Anyway, You can convert to grey scale by mean of RGB components or you can
only take
G as eye is more sensitive to green or you can apply Y=0.715G +
0.2125R+0.0721
This latter is found in one broadcast recommendation to code brightness
function
of RGB, taking in account that eye is not equally sensitive to colors.

Your solution is another one.

I think there is a lot of way to convert, all depend on what you expect to
do with.

One important point you not mentionned and you should not forget is 'color
space'
linearity, managed through 'gamma'. If you expect to extract 'luminance'
from you conversion,
then you should ask yourself where are coming from you RGB data and if there
was a
'gamma' correction applied on. If it was the case, then you shoud apply
inverse gamma correction
before computing luminance Y = 0.715G + 0.2125R+0.0721

For such issues, it should be better to post in news:sci.engr.color

Hope you are not too annoyed by so long response for a so simple question
you should though it was ...

regards


"Stein Kjølstad" <stein.k...@visitech.no> a écrit dans le message news:
4f0d19b5.03081...@posting.google.com...

Stein Kjølstad

unread,
Aug 15, 2003, 1:55:21 AM8/15/03
to
Thanks!

I meant 256 grey scales, not monochrome.

Regards
Stein K

"samourai" <samo...@japan.jp> wrote in message news:<bhgvgp$omb$1...@news-reader4.wanadoo.fr>...

Marco Schmidt

unread,
Aug 15, 2003, 4:09:03 AM8/15/03
to
Stein Kjølstad:

>how should I convert an image stored in RGB565 (5 bit for red, 6 bit
>for green and 5 bit for blue) to an 8 bit monochrome image?

Scale the 5 bit red and blue samples up to 8 bits, do the same with
the 6 bit green sample. Here's more on how to do that:
<http://www.w3.org/TR/PNG#E.Sample-depth-scaling>.

Then do a normal RGB24 => gray8 conversion.

Regards,
Marco

0 new messages