Board index » delphi » Setrgbpalette in 256 gray shades in VGA

Setrgbpalette in 256 gray shades in VGA

Do someone knows the trick to program the 256 colors of VGA BGI units ?
 I want to make a BW camera app and would like to see images in 256
shades of gray, keeping the same code to various types of video cards.
Is it possible ?
  Thanks in advance.
  Ricardo Dunna
 

Re:Setrgbpalette in 256 gray shades in VGA


In article <36ABB067.2...@infolink.com.br>, Ricardo Dunna <rdu...@infolink.com.br> says:

Quote

>Do someone knows the trick to program the 256 colors of VGA BGI units ?
> I want to make a BW camera app and would like to see images in 256
>shades of gray, keeping the same code to various types of video cards.
>Is it possible ?
>  Thanks in advance.
>  Ricardo Dunna

It is my understanding that the VGA hardware only uses 6 bits (0 to 63)
for each red, green and blue. Therefore you can only get 64 different
shades of grey.

Jyrki Lahtonen, Ph.D.
Department of Mathematics,
University of Turku,
FIN-20014 Turku, Finland
Note to human e-mailers! To obtain my real e-mail address form the
string consisting of my first name, a period, my family name (names in
lower case) and an at-sign followed by utu.fi

Re:Setrgbpalette in 256 gray shades in VGA


Quote
Jyrki Lahtonen wrote in message <78hrtn$qr...@news.utu.fi>...
>In article <36ABB067.2...@infolink.com.br>, Ricardo Dunna

<rdu...@infolink.com.br> says:

Quote

>>Do someone knows the trick to program the 256 colors of VGA BGI units ?
>> I want to make a BW camera app and would like to see images in 256
>>shades of gray, keeping the same code to various types of video cards.
>>Is it possible ?
>>  Thanks in advance.
>>  Ricardo Dunna

>It is my understanding that the VGA hardware only uses 6 bits (0 to 63)
>for each red, green and blue. Therefore you can only get 64 different
>shades of grey.

>Jyrki Lahtonen, Ph.D.
>Department of Mathematics,
>University of Turku,
>FIN-20014 Turku, Finland
>Note to human e-mailers! To obtain my real e-mail address form the
>string consisting of my first name, a period, my family name (names in
>lower case) and an at-sign followed by utu.fi

You can increase this by adding a hint of blue to every other shade of blue;

ie    colour0=0,0,0
       colour1=0,0,1
       colour2=1,1,1
       colour3=1,1,2

etc.

Kenn.

Re:Setrgbpalette in 256 gray shades in VGA


Sorry, please replace the last occurance of 'blue' with 'grey'.

Re:Setrgbpalette in 256 gray shades in VGA


Quote
Jyrki Lahtonen wrote in message <78hrtn$qr...@news.utu.fi>...
>It is my understanding that the VGA hardware only uses 6 bits (0 to 63)
>for each red, green and blue. Therefore you can only get 64 different
>shades of grey.

You understanding (and conclusion) is quite correct.

Jay
--

Jason Burgon - author of Graphic Vision
g...@jayman.demon.co.uk
http://www.jayman.demon.co.uk

Re:Setrgbpalette in 256 gray shades in VGA


Quote
Jyrki Lahtonen wrote:
> It is my understanding that the VGA hardware only uses 6 bits (0 to 63)
> for each red, green and blue. Therefore you can only get 64 different
> shades of grey.

This is true for standard VGA.  However, most modern VESA-compliant SVGA
adapters provide programmable DACs which can be switched between 6 and 8 bits
per channel, making it possible to generate 256 true shades of grey in 256
color mode.  Function int 10h, ax=4f08h controls this.  Supported by VESA VBE
1.2+.

Quote
> Jyrki Lahtonen, Ph.D.
> Department of Mathematics,
> University of Turku,
> FIN-20014 Turku, Finland
> Note to human e-mailers! To obtain my real e-mail address form the
> string consisting of my first name, a period, my family name (names in
> lower case) and an at-sign followed by utu.fi

--
Scott Earnest            | SPAM protection in effect. Remove  |
setech@_ix.netcom.com    | "_" as needed for true addresses.  |
earnests@_homenet.lm.com |    UIN:1136443  EFnet:pale_blue    |
sinykal@_{*word*104}space.org  | URL: http://www.netcom.com/~setech |

Other Threads