[Haskell-cafe] Looking to check on some capabilities of Data.Colour

roconnor at theorem.ca roconnor at theorem.ca
Thu Aug 6 16:01:10 EDT 2009


On Thu, 6 Aug 2009, roconnor at theorem.ca wrote:

> On Thu, 6 Aug 2009, Jeff Heard wrote:
>
>> I was wondering if Data.Colour supported Double-valued colour
>> components > 1.0 or less than 0.  I'm looking to create an HDR image
>> processing library, and Haskell has one of the most extensive and
>> correct colour models around, thanks to Russell.  With 16bpcc or
>> 32bpcc images, however, I need to be sure to be able to correctly
>> calculate colour values that fall outside the usual [0.0,1.0] gamut.
>> Does Data.Colour support this functionality?
>
> Data.Colour supports values outside the range [0,1] for most computations.

To be slightly more techinical, I want add that Data.Colour.Colour is 
abstract and its interface cares nothing about [0,1].  Gammut issue only 
arise when converting the abstract data type to and from concrete 
coordinates, and which colours are outside [0,1]*[0,1]*[0,1] is coorinate 
system dependent.  Since Data.Colour.Colour is abstract and coordinate 
system indepenent, it cannot (or at least should not) care about such 
issues for oprations that deal only with abstract colours (operations such 
as blending, etc.)

> Components are clamped when extracting to Bounded component types such as 
> Word8 (see toSRGBBounded).  There may also some issues with negaive values 
> when converting to non-linear coordinate systems via a transfer function. 
> This is an area I haven't thought to much about, so there could be a few 
> "bugs" lurking here.  If found they should be fixed, assuming "right" 
> behaviour can be found.
>
>> 
>> -- Jeff
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>> 
>
>

-- 
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''


More information about the Haskell-Cafe mailing list