From: anders@melander.dk (Anders Melander) Subject: Re: Convert 24 bit -> 8 bit, some problems Date: 15 Feb 1999 00:00:00 GMT Message-ID: <36c98cd4.14800602@forums.borland.com> Content-Transfer-Encoding: 7bit References: <36C83927.CDFB173A@csi.com> Content-Type: text/plain; charset=us-ascii Organization: Melander Inc. Mime-Version: 1.0 Reply-To: anders@melander.dk Newsgroups: borland.public.delphi.graphics Alexandre GUILLIEN wrote: >Hello, I have to convert 24 bits bitmaps to smaller 8 bits ones. I use a >freeware component to convert to make the 24 bits image have only 256 >colors, so the only thing I have to do is to store the bitmap in a 8 bit >format. If you don't mind replacing your color reduction library, you can use the ReduceColors() function in my freeware TGIFImage library. It produces 8 bit TBitmaps, so all you have to do is: var SourceBitmap, DestBitmap: TBitmap; begin SourceBitmap := TBitmap.Create; try SourceBitmap.LoadFromFile('ManyColors.bmp'); // Reduce colors to max 256 (2^8) DestBitmap := ReduceColors(SourceBitmap, rmQuantize, dmFloydSteinberg, 8); try DestBitmap.SaveToFile('FewColor.bmp'); finally DestBitmap.Free; end; finally SourceBitmap.Free; end; end; You can find TGIFImage at: http://www.melander.dk/delphi/gifimage/ Thank you for flying Air Melander. +--------------------from usenet----------------------+ | Anders Bo Melander | Phone: (+45) 38 87 91 26 | | Finsensvej 79, 2. tv. | mailto:anders@melander.dk | | DK-2000 Frederiksberg | http://www.melander.dk | | Denmark | flameto:billg@microsoft.com| +------------------------+----------------------------+