Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!rutgers!im4u!milano!sierchio
From: sierchio@milano.UUCP
Newsgroups: comp.graphics
Subject: Re: A few questions
Message-ID: <3371@milano.UUCP>
Date: Wed, 14-Jan-87 10:15:50 EST
Article-I.D.: milano.3371
Posted: Wed Jan 14 10:15:50 1987
Date-Received: Wed, 14-Jan-87 23:28:41 EST
References: <563@vu-vlsi.UUCP>
Sender: sierchio@milano.UUCP
Organization: MCC, Austin, TX
Lines: 60
Keywords: fractals, color distribution, jobs
Summary: choosing colors


First of all, the choice of an arbitrary color set to represent an image
is one I've been working on for some time.  256 is a tough one, since
you can't allocate a certain number of bits/component as you can if
you have 512 (ffor e.g.). 

The question is, what are you willing to give up?  You may have to give
up some spatial resolution by dithering, and thereby alleviating some of
the problems associated with an arbitrary color set.

Anyway, here's my strategy (you can quote me, and feel free to give me
credit for the idea if it doesn't work for you :-) )

The basic approach is that of histogram specification. (get a book on
image processing)

1)	Construct a histogram of the colors actually in the picture.
	There aren't, by the way 16 million, since you surely don't
	have that many pixels!  The histogram should be a three-
	dimensional matrix that counts the incidence of each triple
	(e.g., this 256 x 256 x 256 matrix will have in location
	[12, 3, 154] the number of pixels with that amnt. of R, G and
	B, respectively.)

2)	The next task is more complicated and less susceptible to
	automation, but I didn't say this was easy. You must then
	find 256 (in your case) loci in this space based on a kind
	of "gravitational attraction" approach. These loci will be
	the colors that nearby colors will be mapped to.

3)	In order not to get ugly quantization effects, which may
	occur because of the arbitrary boundaries that get drawn
	between these subspaces that map to points, I suggest that
	you dither the image when you map it to the reduced-color-map
	space. That means that the process of converting the image
	involves reading a pixel from the original image as input,
	using the histogram and color map you've constructed from
	it to get a new number (the locatiopn in the palette of the
	256 colors you've chosen) and mapping it to the new image.
	If the actual values of the pixel in the original image place
	it near the boundary of another subspace, that's where the 
	dithering comes in -- sometimes you will want to map it to
	the center of the nearby space.

I hope this helps you some.

As to fractal dimension, a line has a fractal dim of 1, so nearly linear
objects have a fractal dim near 1. A plane has fractal dim of 2, so that
fractal curves that have a smaller void fraction and nearly fill the space
of a plane are near dim 2.


-- 
	
	Michael Sierchio @ MCC Software Technology Program

	UUCP:	ut-sally!im4u!milano!sierchio
	ARPA:	sierchio@mcc.ARPA

	"WE REVERSE THE RIGHT TO SERVE REFUSE TO ANYONE"