Shop OBEX P1 Docs P2 Docs Learn Events
bit depth in images — Parallax Forums

bit depth in images

mctriviamctrivia Posts: 3,772
edited 2009-11-21 22:45 in Propeller 1
I have a 16bit bus.

I am trying to figure what is best. 16bit color with 1 color defined as clear or 16 bit color with 4:4:4:4 red[noparse]:green:[/noparse]blue:clear

The second would allow for semitransparent boarders at the cost of 4 bits worth of color

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
24 bit LCD Breakout Board coming soon. $21.99 has backlight driver and touch sensitive decoder.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-11-21 17:54
    If you included the 4-bit alpha channel, how would you implement it? With only four bits per color component, a 16-level transparancy value might be overkill (e.g. How does 11/15 of 4 differ from 10/15 of 4?) Are there other properties of your displayed objects (i.e. blink) that could use one or two of the four alpha bits, perhaps? You could also do 5:5:5:1. The last bit just sets the visibility on and off. Finally, there's no reason that each RGB component needs the same number of bits. Human vision is least sensitive to blue, so maybe 5:5:4:2 would work, giving you four alpha levels.

    -Phil
  • mctriviamctrivia Posts: 3,772
    edited 2009-11-21 18:13
    i think you are right 4 alpha bits is over kill. 5:5:4:2 would be good. gives me lots of colours and still 4 different transparentcy levels.

    I am working on a 480x272x14fps bitmap driver for rays screen. I need transparency for combining the 64 movable sprites with the background. My driver will use up a lot of RAM but I have lots to use:

    2x130560 words for rendered images(doble buffered bitmap of full screen.
    130560 words for background
    up to 1024 words per sprite. I should be able to render 100 sprites by bursting the data between pixels.

    494080 words total a fraction of the 8MWords of RAM I am using.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    24 bit LCD Breakout Board coming soon. $21.99 has backlight driver and touch sensitive decoder.

    Post Edited (mctrivia) : 11/21/2009 6:21:09 PM GMT
  • ericballericball Posts: 774
    edited 2009-11-21 22:27
    Easiest way is to define $0000 as transparent. That way you can quickly detect it during the RDWORD with WZ. Everything else overwrites the background. You will probably find partial transparency is too slow. (Also consider - what happens if two semi-transparent sprites overlap, will it look right?) Sure sprites won't have true black available, but near black will probably be close enough.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: Forum
    NTSC & PAL driver templates: ObEx Forum
    OnePinTVText driver: ObEx Forum
  • mctriviamctrivia Posts: 3,772
    edited 2009-11-21 22:45
    I was thinking the max speed of ram not prop. Would take 16 pixels to read/write each sprite plus a few pixels to make changes. Since I want to keep to 1 cog. The single color transparency will have to do. Something in the purple area would probably be best though to not force re draws of all art.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    24 bit LCD Breakout Board coming soon. $21.99 has backlight driver and touch sensitive decoder.
Sign In or Register to comment.