Author Topic: 7 Level Grayscale Mask  (Read 3205 times)

0 Members and 1 Guest are viewing this topic.

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
7 Level Grayscale Mask
« on: September 02, 2011, 12:29:03 am »
I'm currently working on a 7 - level grayscale routine.

Why not 8?  With 7 level grayscale, each color pattern is equally spaced.  This is one of the reasons why 4 and 3 level can look so perfect (as opposed to 8 level).  (Another culprit is the hideously slow lcd refresh rate, but that is a different story.)

111010 - Not equally spaced (Notice the last 010 and how it makes it look lopsided.)
110110 - Equally spaced (You can chop this in half and get the same 3 bits.)

Code: (Perfectly Spaced 7 - Level) [Select]
000000
100000
100100
101010
110110
011111
111111
Of course, these bits can be in different rotations.

Currently, I only have a 6 - level grayscale routine because I can't figure out a mask.  
Here is what I currently have:
Code: [Select]
Masks:
011011
101010
100100

Patterns:
000000
100100
101010
101110 (bad)
011011
111111 (duplicate)
111011
111111

Can someone please help me find a mask for 7 level grayscale?
Thanks.  :)
« Last Edit: September 02, 2011, 12:31:23 am by ralphdspam »
ld a, 0
ld a, a

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: 7 Level Grayscale Mask
« Reply #1 on: September 02, 2011, 11:12:14 am »
Here's what I came up with, you'll have to number your colors a little funky, but that's expected when you do 7 colors in 3 bits.

Code: [Select]
010101 dark
100010 med
001000 light


6/6 111
5/6 110
4/6 101
3/6 100 ;|discrepancy
2/6 010 ;|
1/6 001
0/6 000

Then you'd just have to rotate it properly, but I'm sure you already know that ;)
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: 7 Level Grayscale Mask
« Reply #2 on: September 02, 2011, 06:27:09 pm »
Thanks.  :)

I'll do some testing to see which method looks better.  I'll probably have to set up a poll or something.  :P
ld a, 0
ld a, a