[cairo] RGB to CIELab transformation

Necko Nedjoni opustenom at hotmail.com
Tue Jan 24 01:22:01 PST 2012


After I had a chance to inform about the CIELab, I believe I should formulate the question differently.Given that I use cairo for pdf output, where the main coloring function is  cairo_set_source_rgb(cr, 1, 0.0, 1.0);I wonder could I output pdf file with colors that I primarily specify in CIELab space.So, given certain slice of the CIELab space, I would like to color the pdf file according to colorsdefined in the slice. Could this be handled by cairo? I got some suggestions on using alternative libraries, but, I suppose this is doable in cairo also.

> Date: Fri, 20 Jan 2012 11:55:17 +0100
> Subject: Re: [cairo] RGB to CIELab transformation
> From: ranma42 at gmail.com
> To: opustenom at hotmail.com
> CC: cairo at cairographics.org
> 
> On Fri, Jan 20, 2012 at 8:01 AM, Necko Nedjoni <opustenom at hotmail.com> 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
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120124/b47b0f0b/attachment-0001.html>


More information about the cairo mailing list