Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!van-bc!rsoft!mindlink!a186 From: Harvey_Taylor@mindlink.UUCP (Harvey Taylor) Newsgroups: comp.sys.amiga.graphics Subject: Summary : How to increase Greyscale levels? Message-ID: <5184@mindlink.UUCP> Date: 15 Mar 91 15:42:50 GMT Organization: MIND LINK! - British Columbia, Canada Lines: 185 Background: I want to display some large 256 level greyscale video samples. The standard Amiga will output only 16 levels. The questions deal with greyscale & how to get the max number of greyscales out of the amiga hardware. Q0: It seems the maximum greyscale range I can get is 16. Why? It seems to me I should be able to get 32 using EHB mode. Yes? No? Q1: In the A2024 docs [in the autodocs] this formula occurs: * * The function is: * Gray Level = (77 * R + 150 * G + 29 * B + 128)/1024 * What is the basis for this? Q2: Dithering Has anybody written an n-bit sample to dithered bitmap routine? Q3: GreyScale to HAM [SHAM, SHAMM, Dynamic whatever] Will HAM (and dynamic brethren) be any use? Q4: A colour board What greyscales do the popular 24 bit boards put out? (ie. DCTV, ColorBurst, HAM-E, A2140, Firecracker 24) Q5: Are there any other options? ---Summary--- Q0: It seems the maximum greyscale range I can get is 16. Why? It seems to me I should be able to get 32 using EHB mode. Yes? No? (peterk@cbmger.UUCP) No, there are physically only 16 shades. In EHB mode, the color is halved, so that you would get half steps, but then is rounded to the next integer step. (alex@bilver.uucp) No. The Amiga video hardware only allows 16 intensity levels for the red, green, and blue electron guns in the CRT. You will notice in your palette setup that there are 4 bits per gun, which means 16 levels. Q1: In the A2024 docs [in the autodocs] this formula occurs: * * The function is: * Gray Level = (77 * R + 150 * G + 29 * B + 128)/1024 * What is the basis for this? (alex@bilver.uucp) This formula approximates the NTSC formula for converting color to black & white. Q2: Dithering Has anybody written an n-bit sample to dithered bitmap routine? (kholland@hydra.unm.edu) It would probably be better to get TAD from ASDG becuase the dithering techniques give a closer simulation of 256 shades of grey (and more natural look, seems to improve resolution). (jbickers@templar.actrix.gen.nz) I'd go with dithering. If you can accept HAM (LORES), then you could also use EXTRA_HALFBRITE mode, which (if you picked some off-gray colors) could give you 64 levels to dither into. > Has anybody written an n-bit sample to dithered bitmap routine? I have, to convert .GIF files to HIRES grayscales. Just a simple ordered dither, though, that only uses a 2x2 thingos, so only 6 bits of the original is considered relevant. I convert color .GIF files into greyscale, then dither away. (chris@kessner.denver.co.us) This should help some. I don't know if you'll get 256 grey-levels, but it's worth a try. Will look very grainy. (James_Hastings-Trew@tptbbs.UUCP) Other than than, you best bet is dithering - HAM and Dynamic modes don't alter the palette available, so still only have 16 greys to work with in those modes. The Art Department does a very nice job of converting 256 greyscale images to 16 greys with Floyd-Steinberg dithering. I daresay at hi-res interlace, the results would be indistinguishable from real 256 grey once you get it into video. (peterk@cbmger.UUCP) Should work. Remember, you can take a HiRes screen, so your resolution is still at least LoRes. (Don't know from heart how many grey scales you can get from this, sure not 256 :-) Dithering references: --------------------- Digital Halftoning - Robert Ulichney MIT Press 1988 ISBN 0-262-21009-6 Computer Graphics, Principles & Practice - Foley, vanDam, Feiner & Hughes Addison Wesley 1990 ISBN 0-201-12110-7 Q3: GreyScale to HAM [SHAM, SHAMM, Dynamic whatever] Will HAM (and dynamic brethren) be any use? (kholland@hydra.unm.edu) As you said the Amiga has only 16 grey scales, therfore HAM is useless since it follows the same principle. I mean, HAM can use only 16 shades but many hues. (chris@kessner.denver.co.us) Won't help. HAM and SHAM (And the dynamic-doodads) all have the same number of gun intensity levels as the normal display modes. (peterk@cbmger.UUCP) If you don't have extra hardware connected: NO solution. Q4: A colour board What greyscales do the popular 24 bit boards put out? (ie. DCTV, ColorBurst, HAM-E, A2140, Firecracker 24) (es1@cunixb.cc.columbia.edu) You can get 256 grey scales with the HAM-E board using 384x480 resolution. The higher model will do anti-aliasing to get you the equivalent of 768x480 resolution. (kholland@hydra.unm.edu) The other way to go is use a 24-bit graphics card. DCTV and the other under 6000 dollar graphics cards are somewhat jokes except for HAM-E becuase you can't really view 24-bit color since NTSC is limited to ~ 21-bit color resolution (2 million colors). It would probably be better to use either HAM-E (300 dollars) or Firecracker 24 (1000-1500 dollars) to do this stuff. (jbickers@templar.actrix.gen.nz) The properly 24-bit ones will put out "enough", by definition. :) At 8 bits per primary, they must be able to do 256 levels of gray. (chris@kessner.denver.co.us) Now this WILL get you somewhere. Well, my experience tells me that DCTV, ColorBusrt, A2410, and FireCracker, all being 24-bit display boards, can give you 256 gun-intensities, and therefore 256 greyscales. HAM-E is a palette-based display. It allows you to display any 256 colors out of 16 million. It can also just as easily display 256 greyscales. It has the added advantage of color-cycling, if you should so need it. (James_Hastings-Trew@tptbbs.UUCP) A 24 bit colour card should be able to give you a true 256 grey scale picture. (peterk@cbmger.UUCP) If it's 24 bits, then yes. Those which really provide 8 bits per color component RGB, give you exactly 256 grey shades. Q5: Are there any other options? (oliphant@telepro.UUCP) I've achieved some rather nice results by usings shades of purple to emulate 32 shades of grey. Here are the colors I use: UWORD colortable[32]={0x000,0x102,0x111,0x213,0x222,0x324,0x333,0x435,0x444, 0x546,0x555,0x657,0x666,0x768,0x777,0x879, 0x888,0x98a,0x999,0xa9b,0xaaa,0xbac,0xbbb,0xcbd,0xccc, 0xdce,0xddd,0xedf,0xeee,0xfef,0xfff,0xfff}; --- -het PS. Got another idea? Send it along... "But now some other stranger seems to want you to ignore his dreams, as though they were the burden of some other." -L.Cohen Harvey Taylor Meta Media Productions uunet!van-bc!rsoft!mindlink!Harvey_Taylor a186@mindlink.UUCP