Re: Reducing number of colors

"Bernhard R. Fischer" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Tuesday 02 July 2013 13:27:00 Chris Wilson wrote:
> On Tue, Jun 25, 2013 at 08:16:22AM +0200, Bernhard R. Fischer wrote:
> > Hi!
> > 
> > Image surfaces are supported as true color (24/32 bit) or 5/6/5 bit
> > pixels.
> > 
> > Is there any native way in cairo to reduce colors to fixed number palette
> > image?
> 
> No, there is nothing inside cairo to perform the quantization you wish -
> it is outside of Cairo's scope.  I would suggest you hook the output of
> your rendering into ImageMagick and use some of its routines to control
> the quantization of the image to a fixed palette.
> -Chris

Hi Chris,

I think that there is some code somwhere which could be used for that purpose 
because it is possible to copy a 24 bit surface to a 16 bit surface which 
obviously requires color reduction.

I already implemented my version of color reduction using the median cut 
algorithm. I'll publish that soon if someone else needs it.

Bernhard

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
signature.asc (application/pgp-signature, 490 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAABAgAGBQJR0sG7AAoJEB2of8NcX/1HbpYH/15cHwCbNPlxhR7dsKPGPwzI
FcMBxtd0mkRolfUXUE+kdIMFI3Th7J+5vYwRbGE/CNidkesUIlmd07/4BS8Jddem
EtO9x2H2lG68lQG8lnDhZQ69iuK6JY7RgwNogGvhg7WnaTvoCu50SkWAriJdQIx3
R4igEZdc5uOAtJieiH884c5p7tTNNzDzVKS8hDrLOb19wN4H09ZLido8zosqx+Oe
x5nSLrZYw7VTrKCkpn1xyMNPoGQ/Epg/SEoSt086zfX/C590sG3G0j6fAC4B6/v9
H2KjAe71j+VnqlTTO8FQ98pD0CVJTAjG5kSfPyRpEYzOH919BrhWdCXUmBZU6V0=
=DdlH
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.