|
![](/i/fill.gif) |
In article <3ee346e3@news.povray.org>,
Lutz-Peter Hooge <lpv### [at] gmx de> wrote:
> > BTW, the TGA format *is* supported, but image maps load it as an
> > ordinary color TGA,
>
> Thats the same as not supported, isn't it?
> Interpolation would scew it up.
No. The interpolation is a weighted average, with the weights
independant of the pixel values. Basically the same goes for the
conversion. It's a very inefficient way to do it, requiring
interpolation of three values when only one would do, but it will work.
ar, ag: red and blue of pixel A
br, bg: red and blue of pixel B
w1, w2: weights of the pixels
Method 1: Combining then interpolating:
(ar*255 + ag)*w1 + (br*255 + bg)*w2
Method 2: Interpolating then combining:
(ar*w1 + br*w2)*255 + (ag*w1 + bg*w2)
Which equals:
ar*w1*255 + br*w2*255 + ag*w1 + bg*w2
Rearrange:
ar*w1*255 + ag*w1 + br*w2*255 + bg*w2
Which equals this, the same as method 1:
(ar*255 + ag)*w1 + (br*255 + bg)*w2
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tag povray org
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |