delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/20/01:21:38

From: "Gil Myers" <gmeyers AT logan DOT net>
Subject: Re: Can I use 256 grayscale colors?
Newsgroups: comp.os.msdos.djgpp
References: <5npo2o$k8v$1 AT jaist-news DOT jaist DOT ac DOT jp> <jsiLPDAezZozEwDD AT talula DOT demon DOT co DOT uk>
Organization: The Unknown Programmers
Message-ID: <01bc79c4$55640360$fd8033cf@pentium>
NNTP-Posting-Host: 207.51.128.253
Date: 15 Jun 97 19:31:29 GMT
Lines: 287
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk> wrote in article
<jsiLPDAezZozEwDD AT talula DOT demon DOT co DOT uk>...
> SUGANUMA yoshinori writes:
> >I would like to use 256 grayscale colors with djgpp.
> >Is it possible? and are there any libraries to do so?

<snipped some stuff here>

> Allegro just uses the standard VGA format, with the values ranging 0-63.
> You could just divide each intensity by four, to get 64 scales of grey
> with each color duplicated four times, or you could try doing a sort of
> dither by slightly offsetting the three color components, so they
> wouldn't all be exact greys but you would get more unique shades (it
> would need some experimenting to find the best values for this, I never
> tried it myself...)

If you know what fractint is,  it comes with two pseudo 256 level grayscale
palettes. (the files are in plain ascii format,  easy to read.)

Anyways,  they are essentially the 64 gray palette,  with a little
twiddling of the
blue and green registers to give a smoother palette.

I'll go ahead and attach the Gamma 1 to this post.  (It will have to be
scaled to
the 0..63 range,  but it might be helpful.  I mean,  why re-invent the
wheel?)

-------------------CUT HERE---------------------------------
0 0 0     Pseudo-gray sequence optimized for images encoded at a gamma near
1.0
20 12 20  Modification of the Peterson/Vigneau Sequence by Lee Daniel
Crocker
24 20 28
24 28 32
32 32 28
32 36 40
44 36 36
36 44 44
44 44 48
44 48 52
48 52 44
52 52 56
60 52 52
52 60 52
64 56 60
64 60 60
64 64 56
64 64 72
72 64 68
72 68 64
76 68 68
72 72 76
72 76 68
76 76 72
72 80 76
84 76 80
80 80 84
80 84 76
84 84 80
84 84 92
92 84 84
88 88 88
84 92 88
88 92 92
92 92 92
88 96 92
92 96 96
96 96 96
92 100 96
104 96 96
100 100 100
100 100 108
100 104 100
104 104 100
108 104 100
104 108 100
108 108 100
108 108 112
112 108 108
116 108 108
112 112 108
108 116 108
112 116 108
120 112 116
116 116 116
116 116 124
120 116 124
120 120 112
120 120 120
124 120 120
124 120 128
120 124 128
124 124 128
128 124 124
128 124 132
124 128 132
128 128 128
124 132 128
132 128 136
132 132 124
132 132 132
132 132 140
132 136 128
132 136 136
136 136 132
132 140 132
132 140 140
144 136 136
144 136 144
140 140 144
136 144 140
144 140 148
148 140 144
144 144 140
140 148 140
140 148 148
144 148 144
148 148 140
148 148 148
148 148 156
152 148 152
156 148 148
156 148 156
152 152 152
152 152 160
152 156 148
160 152 152
160 152 160
156 156 156
156 156 164
156 160 152
164 156 156
164 156 164
160 160 160
160 160 168
164 160 164
168 160 160
160 164 168
164 164 164
168 164 160
160 168 168
164 168 164
168 168 160
168 168 164
168 168 172
172 168 168
168 172 164
168 172 172
176 168 176
172 172 172
172 172 180
168 176 176
172 176 172
176 176 168
176 176 172
176 176 180
172 180 176
176 180 172
184 176 176
176 180 184
180 180 180
176 184 176
184 180 180
180 184 176
180 184 184
188 180 188
184 184 184
180 188 180
188 184 184
188 184 192
184 188 188
192 184 192
188 188 188
184 192 184
192 188 188
192 188 196
188 192 192
196 188 196
192 192 192
188 196 188
196 192 192
192 196 188
200 192 192
192 196 200
196 196 196
196 196 200
192 200 196
200 196 200
196 200 196
204 196 200
200 200 196
200 200 204
200 200 208
196 204 204
204 200 208
200 204 204
208 200 208
204 204 204
204 204 208
200 208 204
208 204 208
204 208 204
212 204 208
208 208 204
208 208 208
212 208 204
212 208 208
208 212 204
216 208 208
212 212 204
212 212 208
212 212 216
212 212 220
208 216 216
216 212 220
212 216 216
212 216 220
216 216 216
216 216 220
216 216 224
212 220 220
220 216 224
216 220 220
216 220 224
220 220 220
220 220 224
220 220 228
216 224 224
224 220 228
220 224 224
224 224 216
224 224 220
224 224 228
224 224 232
228 224 224
224 228 220
232 224 224
228 228 220
228 228 224
228 228 228
224 232 224
232 228 228
232 228 232
228 232 228
236 228 232
236 228 236
232 232 232
232 232 236
232 232 240
228 236 236
236 232 240
240 232 232
236 236 228
236 236 232
236 236 236
232 240 232
240 236 236
240 236 240
236 240 236
236 240 240
244 236 244
240 240 240
240 240 244
240 240 248
244 240 240
240 244 236
248 240 240
248 240 244
244 244 240
244 244 244
244 244 248
244 244 252
240 248 248
244 248 240
252 244 244
248 248 240
248 248 244
248 248 248
248 248 252
244 252 248
244 252 252
248 252 244
248 252 248
252 252 244
252 252 248
252 252 252

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019