Am 22.10.2012 20:49, schrieb Cousin Ricky:
> Ive <ive### [at] lilysoftorg> wrote:
>> The common way for *visual* best results works like this:
>> transform the rgb out-of-gamut value to L*a*b and from there to Lch.
>> Lower the chrominance channel until the rgb value falls back into gamut.
>> This is the tricky part as you do not know before-head when this happens
>> so some clever interpolation method is needed.
>
> I'll have to do a little more reading and a lot more grokking before I can do
> this.
>
>
rgb -> Lch (and visa versa) conversion is part of CIE.inc and for
finding the best Lch chroma value something like a binary search should
do the trick: reduce the actual value by half, convert back to rgb and
check if it is inside or outside the gamut. If still outside reduce
chroma again by half, if inside use the middle between the previous and
current value. Repeat this until a certain threshold is reached.
I'll have to admit that I was lazy and didn't implement it but this is
how the ICC recommends gamut mapping for the perceptual viewing intend.
-Ive
Post a reply to this message
|