POV-Ray : Newsgroups : povray.binaries.images : texture interpolation... why rgb ? : Re: texture interpolation... why rgb ? Server Time
2 Aug 2024 10:27:13 EDT (-0400)
  Re: texture interpolation... why rgb ?  
From: scott
Date: 30 Nov 2007 04:32:24
Message: <474fd8a8$1@news.povray.org>
>> Oh I knocked up a quick program to interpolate between two colours in
>> RGB space and Yuv space.  In each pair, the top version is RGB, the
>> lower version is Yuv.
>
>  The yuv interpolation doesn't look half-bad.

I realised an improvement though.

Although the "colour" part (u and v) is supposed to be interpolated evenly, 
the Y part will not be.  Y is linear luminance, ie not gamma corrected, so 
interpolating it directly will not give a very "even" looking result (there 
will be too much "white").

So I modified the code to do this (now a black-white gradient looks 
identical in both RGB and Yuv interpolation) and it looks a bit better, 
especially when going from dark to light colours.  Again, top bar is RGB and 
lower bar is Yuv.

Also, the problem with converting from RGB to Yuv and back is that it 
assumes your display device is exactly calibrated to a standard (I used sRGB 
in the calculations).  If it's not then the results won't look as good as 
they could.


Post a reply to this message


Attachments:
Download 'interpolation comparison 2.png' (3 KB)

Preview of image 'interpolation comparison 2.png'
interpolation comparison 2.png


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.