POV-Ray : Newsgroups : povray.binaries.images : texture interpolation... why rgb ? : Re: texture interpolation... why rgb ? Server Time
5 Nov 2024 04:23:30 EST (-0500)
  Re: texture interpolation... why rgb ?  
From: scott
Date: 29 Nov 2007 09:10:53
Message: <474ec86d$1@news.povray.org>
> There is no point in trying YUV/YIQ/Secam/Pal/NTSC... colorspace as
> they are matrix transformation of RGB, and as such keep the same result.

Yuv certainly isn't a simple matrix transform, which is why I mentioned it 
earlier.

FYI to convert from RGB to Yuv do the following (via XYZ):

XYZ = [some_matrix] * RGB
(the matrix depends on which colour space your RGB is in, choose sRGB, PAL, 
NTSC whatever)

x = X/(X+Y+Z)
y = Y/(Y+Y+Z)

u = 2*x/(6*y-1.5*x)
v = 4.5*y/(6*y-1.5*x)

Y will give you the "brightness" and uv will give you the colour. 
Interpolating uv linearly will give the smoothest change in colour, as each 
distance in your "picture" will correspond to an equal change in "colour" as 
the eye sees it.


Post a reply to this message

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