![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
How about a color_matrix? It would simply transform the colors of the
image according to a matrix, it should make a lot of effects possible.
This one should be easy enough to implement, I will make it my next
project.
After that, I will try the blur/convolution/displacement matrix(still
not sure if "convolution matrix" is the right name for it).
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 25 Apr 2000 07:23:17 -0500, Chris Huff
<chr### [at] yahoo com> wrote:
>How about a color_matrix? It would simply transform the colors of the
>image according to a matrix, it should make a lot of effects possible.
I'm not sure what you mean. Would you mind explaining more about what
you have in mind? A hypothetical example would be great.
Thanks,
Glen
( Remove the "7" from 7no### [at] ezwv com to email me. )
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <B5QFORZjezhKLtkTgr2FzuvyFcJQ@4ax.com>, Glen Berry
<7no### [at] ezwv com> wrote:
> On Tue, 25 Apr 2000 07:23:17 -0500, Chris Huff
> <chr### [at] yahoo com> wrote:
>
> >How about a color_matrix? It would simply transform the colors of the
> >image according to a matrix, it should make a lot of effects possible.
>
> I'm not sure what you mean. Would you mind explaining more about what
> you have in mind? A hypothetical example would be great.
It would be a 3*3 matrix, like this:
<AA, AB, AC,
BA, BB, BC,
CA, CB, CC>
resultRed = AA*inputRed + AB*inputGreen + AC*inputBlue;
resultGreen = BA*inputRed + BB*inputGreen + BC*inputBlue;
resultBlue = CA*inputRed + CB*inputGreen + CC*inputBlue;
This matrix would not make any change:
< 1, 0, 0,
0, 1, 0,
0, 0, 1>
This one would reverse the red and green components of the image:
< 0, 1, 0,
1, 0, 0,
0, 0, 1>
and so on.
BTW, I just got it to compile, time for testing. Oh, and another change
I made was allowing post_process to be specified in the camera
statement.(which is where I think it should have been in the first
place) :-)
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 25 Apr 2000 08:11:28 -0500, Chris Huff
<chr### [at] yahoo com> wrote:
>It would be a 3*3 matrix, like this:
>
><AA, AB, AC,
> BA, BB, BC,
> CA, CB, CC>
>
>
>resultRed = AA*inputRed + AB*inputGreen + AC*inputBlue;
>resultGreen = BA*inputRed + BB*inputGreen + BC*inputBlue;
>resultBlue = CA*inputRed + CB*inputGreen + CC*inputBlue;
How hard would it be to do something like the following?
resultRed = ( ((R+G+B)/3)^0.95)*1.05
resultGreen = (R+G+B)/3
resultBlue = ((R+G+B)/3)^0.9
This gives a fairly close approximation of Selenium Toning.
Or maybe this?
resultRed = ((R+G+B)/3)^0.67
resultGreen = ((R+G+B)/3)^0.85
resultBlue = ((R+G+B)/3)
This gives a fairly close approximation of Sepia Toning
Or maybe even this?
output_Red = 100*sin(R*pi*3)
output_Green = 100*cos(G*pi*3)
output_Blue = -100*sin(B*pi*3)
This gives a very wild posterization effect
Note: For the purpose of these examples, R = the values contained in
the Red channel *after* clipping/normalizing to values between 0 and
1. "G" and "B" refer to the Green and Blue channels in a likewise
manner.
I also wanted to ask if the values you are manipulating in your matrix
are the raw unclipped values, or have they already been clipped? It
might be handy to apply a matrix or a formula to either situation, for
different reasons. The above effects are meant to work with values
constrained between 0 and 1, but if I wanted to control image
contrast, I would need to work with the raw unclipped valiues.
Later,
Glen Berry
( Remove the "7" from 7no### [at] ezwv com to email me. )
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 25 Apr 2000 07:23:17 -0500, Chris Huff
<chr### [at] yahoo com> wrote:
>After that, I will try the blur/convolution/displacement matrix(still
>not sure if "convolution matrix" is the right name for it).
Make sure you provide the option to set the matrix size, the divisor
and the levelling value as well. This will give a lot of
possibilities.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usa net
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <njUGOUFjcnSZ3qj34lbk51m8BluE@4ax.com>, Glen Berry
<7no### [at] ezwv com> wrote:
> How hard would it be to do something like the following?
> ...
> This gives a fairly close approximation of Selenium Toning.
>
> Or maybe this?
> ...
> This gives a fairly close approximation of Sepia Toning
>
> Or maybe even this?
> ...
> This gives a very wild posterization effect
Those would be quite easy to do...but not in color_matrix. They should
all be possible with the specialized isosurface function idea though...
> I also wanted to ask if the values you are manipulating in your matrix
> are the raw unclipped values, or have they already been clipped? It
> might be handy to apply a matrix or a formula to either situation, for
> different reasons. The above effects are meant to work with values
> constrained between 0 and 1, but if I wanted to control image
> contrast, I would need to work with the raw unclipped valiues.
They are the raw, unclipped values. Maybe a clip_colors filter would be
useful, so different versions of each filter don't have to be made.
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <nuhcgskdd7i2em02o2uri3ev28c51fjemm@4ax.com>, Peter Popov
<pet### [at] usa net> wrote:
> Make sure you provide the option to set the matrix size,
I already have a working version. The matrix dimensions can be whatever
you want, though odd numbers are preferred. The matrix does not have to
be square.
> the divisor
Not implemented yet, I got sidetracked with other filters. It is
planned, though.
> and the levelling value as well.
Levelling value? I don't understand this one...
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Perhaps something like this:
#declare ColoringFunction = function { x*.25+y*.6+z*.15 }
global_settings
{ post_process { pixel_color ColoringFunction(Red, Green, Blue) }
}
or:
#declare RedFunction = function { ... }
#declare GreenFunction = function { ... }
#declare BlueFunction = function { ... }
global_settings
{ post_process
{ pixel_color <RedFuntion(Red, Green, Blue),
GreenFunction(Red, Green, Blue),
BlueFuntion(Red, Green, Blue)>
}
}
or something similar.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3906b624@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> Perhaps something like this:
>
> #declare ColoringFunction = function { x*.25+y*.6+z*.15 }
>
> global_settings
> { post_process { pixel_color ColoringFunction(Red, Green, Blue) }
> }
>
> or:
>
> #declare RedFunction = function { ... }
> #declare GreenFunction = function { ... }
> #declare BlueFunction = function { ... }
>
> global_settings
> { post_process
> { pixel_color <RedFuntion(Red, Green, Blue),
> GreenFunction(Red, Green, Blue),
> BlueFuntion(Red, Green, Blue)>
> }
> }
>
> or something similar.
What I was thinking of was something like this:
global_settings or camera {
post_process {
post_function < function {...red function...},
function {...green function...},
function {...blue function...} >
}
}
And there would be additional variables:
r, g, b - unclipped RGB colors.
x, y, z - intersection point.
u, v - UV coordinates.
depth - distance to intersection point.
inorm_x, inorm_y, inorm_z - surface normal at intersection point.
pnorm_x, pnorm_y, pnorm_z - perturbed surface normal.
dir_x, dir_y, dir_z - ray direction(if I succeed in adding it to
the available information).
You could use this filter to do the same thing as the color_matrix
filter, and just about anything else that doesn't require information on
other pixels:
post_function < function {r*AA + g+AB + b*AC},
function {r*BA + g+BB + b*BC},
function {r*CA + g+CB + b*CC} >
Another possibility would be to implement these variables as functions
taking two parameters(pixel coordinates), and add h and v variables for
pixel coordinates...the functions would return the information for the
specified pixel. This would be tremendously flexible, and would allow
blurring filters.
--
Christopher James Huff - Personal e-mail: chr### [at] yahoo com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 25 Apr 2000 21:04:07 -0500, Chris Huff
<chr### [at] yahoo com> wrote:
>Levelling value? I don't understand this one...
It's just a constant you add to the weighted sum before you divide it
by the divisor.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usa net
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |