Xref: utzoo comp.graphics:8751 comp.sys.mac.programmer:10721
Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!dlogics!kam
From: kam@dlogics.UUCP (Kevin Mitchell)
Newsgroups: comp.graphics,comp.sys.mac.programmer
Subject: Converting color values to color indices
Keywords: color index inverse table algorithm request
Message-ID: <248@dlogics.UUCP>
Date: 29 Nov 89 14:35:28 GMT
Followup-To: comp.graphics
Organization: Datalogics Inc., Chicago
Lines: 27
I'm using a Floyd-Steinburg dither to reduce the number of colors in
an image. To find the colors I need quickly, I'm using an inverse table-
a three-dimensional array indexed by color value yielding the color index
to put into the image.
Right now, I'm comparing each color position in the inverse table to
each color in the color lookup table to find the index I want. Since I'm
using the Pythagorean Theorem to find the distance, I'm executing thousands
of multiplications and it takes a long time (Macintosh Plus; 68000 at 8Mhz).
I must be missing something obvious, since I know that there are fast
implementations out there; such as in Apple's color QuickDraw software.
Please reply if you have any comments on:
o Fast ways of stuffing inverse color tables.
o Better ways of converting colors to color indices.
Thanks.
--
Kevin A. Mitchell (312) 266-4485
Datalogics, Inc Internet: kam@dlogics.UUCP
441 W. Huron UUCP: ..!uunet!dlogics!kam
Chicago, IL 60610 FAX: (312) 266-4473