delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/22/14:23:51

Date: Wed, 22 Oct 1997 14:11:06 -0400 (EDT)
Message-Id: <199710221811.OAA25850@delorie.com>
To: DJGPP mailing list <djgpp AT delorie DOT com>
From: Alexander Bokovoy <bokovoy AT bspu DOT ac DOT by>
Subject: Re: Colors in a consistent way.
In-Reply-To: <3.0.16.19971021133718.36cf2982@hem1.passagen.se>
References: <3 DOT 0 DOT 16 DOT 19971021133718 DOT 36cf2982 AT hem1 DOT passagen DOT se>
MIME-Version: 1.0

On Tue, 21 Oct 1997 13:38:11 -0400 Peter Palotas <blizzar AT hem1 DOT passagen DOT se> wrote:

> In a GUI, or another program that will work in multiple graphic modes,how
> should one handle colors in a consistent way? In 15, 16, 24, 32 bit modes
> this is no real problem, all you need to do is use a function like
> allegro's makecol() which will return a proper color value. 
> 
> But how should one handle the palette in 256 color modes? If one for
> example wants the user to be able to load several pictures, and they all
> should look good. One would then have to dither the pictures, but to what
> palette? Should one stick to a standard palette all the time, or should one
> change it dynamically?
> 
> How does ex. browsers in windows 256 color mode do this? I.e. does Netscape
> have a consistent palette or does it change? (I have a list of 220 or so
> colors that Netscape and internet explorer doesn't dither, so I suppose
> those colors are always there, but what about the rest?)
> 

For example how to implement dithering algorithm you can see in SWORD's
sources (src/graphics/colors.cc and tools/colors/colors.cc).The first is
a "dither client" and the second is a program that computes a dithering
table.
Another way (I'm not sure but it may be work) is implemented in MGL
sources (see src/quick3d/srgbmod.cpp).

The SWORD's model has advantage in speed but it costs some memory (
usually about 500k in 2.0 version and 192k in SWORD 2.50 beta prerelease).
MGL's model is compact but do floating point calculations during
dithering. You may agree with it if prefer a program slowdown.

Alexander Bokovoy, <bokovoy AT bspu DOT ac DOT by>
---== The Soft Age coming soon ==---

- Raw text -


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