Re: RGB to CIELab transformation

Andrea Canciani <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAN_5=BDyNJ76d_NA=JX2GadRpdGW9XSTTGM+8KO3wmR0EpHtKg@mail.gmail.com>
On Fri, Jan 20, 2012 at 8:01 AM, Necko Nedjoni <[email protected]> wrote:
> As a part of a larger project, I was recently assigned to investigate the
> possibility of colorings
> within our visualizations.
> Namely, I came across the CIELab color space, which seems to be preferable
> choice in the related
> literature. The initial readings suggest that a conversion from
> device-depended RGB is possible, and
> I wonder how this could be achieved with cairo.

Converting a color in a device-dependent colorspace to a color in a
device-independent colorspace is not actually a meaningful operation.
You might assume that the RGB components are in a specific
device-independent colorspace (given current cairo behavior I would
suggest a linear rgb colorspace with the same primaries as sRGB or
sRGB itself).
You could then use normal color conversion routines, like those
provided by LittleCMS.

>
> The function I use currently (sample):
>
> cairo_set_source_rgb(cr, 1, 0.0, 1.0);
>
> Perhaps someone could share the conversion code.

I should have something that does it in my colorspaces branches.
I will try to extract it to a standalone snippet.

Andrea

>
> --
> cairo mailing list
> [email protected]
> http://lists.cairographics.org/mailman/listinfo/cairo
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
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.