Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #150914

Re: [offtopic][retro] 16 color palette definition

From BGB <cr88192@gmail.com>
Newsgroups comp.lang.c
Subject Re: [offtopic][retro] 16 color palette definition
Date 2020-03-30 13:45 -0500
Organization A noiseless patient Spider
Message-ID <r5teo7$u18$1@dont-email.me> (permalink)
References <25df9d14-a1ff-4dd0-bad1-a8b60a430d1a@googlegroups.com> <00719934-9c32-47b4-858f-524d821558a7@googlegroups.com> <2ce706bf-81e6-4782-b2bc-9be16a5d1574@googlegroups.com> <C7KfG.182215$_3E.157994@fx15.am4> <V1qgG.311950$_3E.279744@fx15.am4>

Show all headers | View raw


On 3/30/2020 12:31 PM, Bart wrote:
> On 28/03/2020 15:33, Bart wrote:
> 
>>
>> Without a palette you need a minimum of 8 bits (say 3G+3R+2B) for 
>> general colour, or ideally 12 bits.
> 
> If stuck with 4 bits, and able to use a palette, then there is no clear 
> way of using RGB, as you use 1 bit for each of R, G, B, but then what 
> purpose is the 4th bit?
> 
> So I think it might be worth looking at using CMYK instead. C,M,Y,K are 
> used in printing, as either on or off. So such 4-bit colour pixels could 
> be used to show photos, given enough pixels and using dithering or 
> half-tone patterns.

Could also do 1-bpp, but organize pixels in a Bayer pattern, eg:
  G R
  B G

Then, the pattern of pixels in each 4x4 block encodes which color the 
block pixels should be:
  1 1 0 0  //Pixels are white-on-black
  1 1 0 0
  0 0 1 1
  0 0 1 1
And:
  1 1 0 0  //Pixels are yellow-on-blue
  0 1 1 0
  0 0 1 1
  1 0 0 1
...

Then 2x2 sub-blocks are "foreground" or "background" depending on what 
pattern of pixels is set. Likewise, if the OR of the background 
sub-blocks encodes for white, the block is interpreted as monochrome 
white-on-black.

So:
  0 0, 0 0: Background, Black
  0 0, 0 1: Background, Green
  0 0, 1 0: Background, Blue
  0 0, 1 1: Background, Cyan
  0 1, 0 0: Background, Red
  0 1, 0 1: Background, Yellow
  0 1, 1 0: Background, Magenta
  0 1, 1 1: Monochrome Hint
  1 0, 0 0: Foreground, -
  1 0, 0 1: Foreground, Green
  1 0, 1 0: Foreground, Blue
  1 0, 1 1: Foreground, Cyan
  1 1, 0 0: Foreground, Red
  1 1, 0 1: Foreground, Yellow
  1 1, 1 0: Foreground, Magenta
  1 1, 1 1: Foreground, White

But, dunno how useful this would be...

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 03:54 -0700
  Re: [offtopic][retro] 16 color palette definition felix@palmen-it.de (Felix Palmen) - 2020-03-28 12:11 +0100
    Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 05:45 -0700
      Re: [offtopic][retro] 16 color palette definition felix@palmen-it.de (Felix Palmen) - 2020-03-28 15:41 +0100
        Re: [offtopic][retro] 16 color palette definition BGB <cr88192@gmail.com> - 2020-03-30 08:05 -0500
          Re: [offtopic][retro] 16 color palette definition felix@palmen-it.de (Felix Palmen) - 2020-03-30 17:43 +0200
            Re: [offtopic][retro] 16 color palette definition BGB <cr88192@gmail.com> - 2020-03-30 12:04 -0500
  Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 04:16 -0700
    Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 05:32 -0700
  Re: [offtopic][retro] 16 color palette definition bert <bert.hutchings@btinternet.com> - 2020-03-28 07:05 -0700
    Re: [offtopic][retro] 16 color palette definition Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-28 08:13 -0700
      Re: [offtopic][retro] 16 color palette definition Bart <bc@freeuk.com> - 2020-03-28 15:33 +0000
        Re: [offtopic][retro] 16 color palette definition Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-28 08:40 -0700
          Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 08:58 -0700
            Re: [offtopic][retro] 16 color palette definition Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-28 09:08 -0700
              Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 09:31 -0700
                Re: [offtopic][retro] 16 color palette definition Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-28 10:51 -0700
                Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 11:03 -0700
                Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 11:10 -0700
        Re: [offtopic][retro] 16 color palette definition Bart <bc@freeuk.com> - 2020-03-30 18:31 +0100
          Re: [offtopic][retro] 16 color palette definition Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-30 11:26 -0700
            Re: [offtopic][retro] 16 color palette definition Bart <bc@freeuk.com> - 2020-03-30 21:09 +0100
          Re: [offtopic][retro] 16 color palette definition BGB <cr88192@gmail.com> - 2020-03-30 13:45 -0500
          Re: [offtopic][retro] 16 color palette definition Eli the Bearded <*@eli.users.panix.com> - 2020-03-31 18:56 +0000
            Re: [offtopic][retro] 16 color palette definition Bart <bc@freeuk.com> - 2020-03-31 20:32 +0100
              Re: [offtopic][retro] 16 color palette definition Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-03-31 13:51 -0700
      Re: [offtopic][retro] 16 color palette definition BGB <cr88192@gmail.com> - 2020-03-29 22:40 -0500
  Re: [offtopic][retro] 16 color palette definition Bonita Montero <Bonita.Montero@gmail.com> - 2020-03-28 16:09 +0100
  Re: [offtopic][retro] 16 color palette definition Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-03-28 14:10 -0400
    Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 11:59 -0700
      Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 12:02 -0700
        Re: [offtopic][retro] 16 color palette definition fir <profesor.fir@gmail.com> - 2020-03-28 12:49 -0700
    Re: [offtopic][retro] 16 color palette definition Jorgen Grahn <grahn+nntp@snipabacken.se> - 2020-03-28 20:57 +0000

csiph-web