colorpict and materials

Hi!

I have a question regarding the proper use of colorpicts.

I have "calibrated" pics of materials (using macbethcal) that I used to get the rgb-values for material definitions. These samples have typically dimensions of about 30 x 20 cm (similar to the Macbeth colorchecker). I rendered using the materials colors obtained from these samples.

Now I want to map pictures onto the surfaces. I still want to use the color as obtained from the sample. But the mapped picture is usually much larger than the sample. So I would need a way to bring the average color of the picture to the (average) color of the calibrated sample. Is there a way to do that with Radiance's tools? I could use these mappings on a clear white (.9 .9 .9) surface than, right?

Is there a way to use the pic only as variation of the color? E.g. converting from radiance pic to a file that could be used by brightdata? I could use the color from the calibrated (small) sample than, and the big pattern only to map some structure.

The way I used so far: applying normpat to a grayscale pattern, and mapping that onto the surface which has the color measured from the sample. Similar to using brightdata, and not able to reflect the color variation.

Thanks, CU Lars.

···

--
Lars O. Grobe, [email protected], ++90-212-2458330

Kardesler Apartment, Turnacibasi Sokak 28
Galatasaray - Beyoglu, 34433 Istanbul

Hi Lars,

I guess no one really understood your question. I'm away on travel, with spotty access to e-mail, so I missed this one. I still think I'm missing the question. You can use the pfilt command to adjust the overall image brightness used by brightpict or colorpict -- is this what you're asking?

-Greg

···

From: "Lars O. Grobe" <[email protected]>
Date: June 24, 2004 11:06:45 AM GMT+01:00

Hi!

I have a question regarding the proper use of colorpicts.

I have "calibrated" pics of materials (using macbethcal) that I used to get the rgb-values for material definitions. These samples have typically dimensions of about 30 x 20 cm (similar to the Macbeth colorchecker). I rendered using the materials colors obtained from these samples.

Now I want to map pictures onto the surfaces. I still want to use the color as obtained from the sample. But the mapped picture is usually much larger than the sample. So I would need a way to bring the average color of the picture to the (average) color of the calibrated sample. Is there a way to do that with Radiance's tools? I could use these mappings on a clear white (.9 .9 .9) surface than, right?

Is there a way to use the pic only as variation of the color? E.g. converting from radiance pic to a file that could be used by brightdata? I could use the color from the calibrated (small) sample than, and the big pattern only to map some structure.

The way I used so far: applying normpat to a grayscale pattern, and mapping that onto the surface which has the color measured from the sample. Similar to using brightdata, and not able to reflect the color variation.

Thanks, CU Lars.
--
Lars O. Grobe, [email protected], ++90-212-2458330

Kardesler Apartment, Turnacibasi Sokak 28
Galatasaray - Beyoglu, 34433 Istanbul

Hi,

sorry, so again, I try to be clear in asking this time :wink: By the way, have nice holidays (I hope that's the reason for your travel ;-)!

All is about the question how to map pictures onto a surface without corrupting its material properties. I understand that colorpict multiplies the material color components with those of the picture.

If I have a grayscale image processed by normpat (which means that the average gray value is 1.0) and apply it to a material, the overall color and brightness will remain the same. So I get the "pattern" from the image, but the surface still has the correct material properties (color, brightness etc). I used this so far.

Now I want to use a colored picture for mapping. I also apply normpat to it, so, as far as I understand, the average of all R, G and B must be 1.0, right? For example, I use a normpat'ed picture of green marble. I than apply this using colorpict to a surface, which has a "marble" material. Will the overall color and brightness still be that of the defined material, as the picture map has the average of 1.0?

The background: I try to use exact data for material definitions, but the image maps can't all be color corrected. So I want the overall color and brightness from defined materials, e.g. from the plastic material, and use the map only for what I would call "local color variation". The reason is that I have e.g. red marble, got its color, brightness and all that defined as plastic marble. But the marble has blue particles which won't appear if I use a grayscale imagemap. So I want to use a normpat'ed (NOT colorcorrected e.g. by macbethcal!) to bring these blue parts onto the surface. The whole surface however must still have the average color of my plastic marble material.

If I understand the man-page of normpat, that's just what it was invented for. However, I am a bit unsure, as all Radiance documentation uses colorpict with a bright white material.

TIA+CU, Lars.

···

--
Lars O. Grobe
[email protected]

Hi Lars,

I believe that what you need to do is take your colorpict modifier and apply it to a material such as a plastic that uses the reflectance of your material sample as the rgb parameters. I believe that you DO want to use macbethcal to callibrate the color values of the image and determine an estimated reflectance. Then using normpat on the image will move the values in image so the average is 1.0.

So steps as follows:

   1. acquire sample material image by photography, scan....
   2. callibrate sample image with macbethcal
   3. use callibrated sample image to estimate average color
   4. calculate reflectance based on average color values, grey(r,g,b)
   5. normpat the callibrated image

Then create material as follows:

void colorpict color.image.pattern
7 red green blue <normpat picture>.pic picture.cal Px Py
0
1 <aspect>

color.image.pattern plastic color.image.material
0
5 <grey(r,g,b)> <grey(r,g,b)> <grey(r,g,b)> <s> <r>

Since the colorpict is normalized to an average value of one, it will modify the plastic around the reflectance of the plastic. For example, if colorpict returns 1.1 for red then the red of the plastic will be 10% brighter.

In short I think that there are two main ways to use colorpict

   1. final reflectance set by colorpict image - colorpict is used to
      set final reflectance of material, that is use callibrated image
      colorpict modifier and material with reflectance of 1.0
   2. final reflectance set by base material - colorpict is used to
      modify reflectance set by material, that is normpat image
      colorpict modifier is used to modify reflectance set by material

I hope this is helpful.

Regards,

-Jack

Lars O. Grobe wrote:

···

Hi,

sorry, so again, I try to be clear in asking this time :wink: By the way, have nice holidays (I hope that's the reason for your travel ;-)!

All is about the question how to map pictures onto a surface without corrupting its material properties. I understand that colorpict multiplies the material color components with those of the picture.

If I have a grayscale image processed by normpat (which means that the average gray value is 1.0) and apply it to a material, the overall color and brightness will remain the same. So I get the "pattern" from the image, but the surface still has the correct material properties (color, brightness etc). I used this so far.

Now I want to use a colored picture for mapping. I also apply normpat to it, so, as far as I understand, the average of all R, G and B must be 1.0, right? For example, I use a normpat'ed picture of green marble. I than apply this using colorpict to a surface, which has a "marble" material. Will the overall color and brightness still be that of the defined material, as the picture map has the average of 1.0?

The background: I try to use exact data for material definitions, but the image maps can't all be color corrected. So I want the overall color and brightness from defined materials, e.g. from the plastic material, and use the map only for what I would call "local color variation". The reason is that I have e.g. red marble, got its color, brightness and all that defined as plastic marble. But the marble has blue particles which won't appear if I use a grayscale imagemap. So I want to use a normpat'ed (NOT colorcorrected e.g. by macbethcal!) to bring these blue parts onto the surface. The whole surface however must still have the average color of my plastic marble material.

If I understand the man-page of normpat, that's just what it was invented for. However, I am a bit unsure, as all Radiance documentation uses colorpict with a bright white material.

TIA+CU, Lars.
--
Lars O. Grobe
[email protected]

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
# John E. de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Hi Jack,

thank You for the reply.

2. final reflectance set by base material - colorpict is used to modify reflectance set by material, that is normpat image colorpict modifier is used to modify reflectance set by material

I want to do this, I have the material values, the colorpict is just to add some visual credibility :wink: But I also want to have the final overall (that means the average over the whole surface, like selecting an area in ximage vs. a point) color from the base material.

So steps as follows:

1. acquire sample material image by photography, scan....
2. callibrate sample image with macbethcal
3. use callibrated sample image to estimate average color
4. calculate reflectance based on average color values, grey(r,g,b)
5. normpat the callibrated image

So, if I already have the rgb for the base material (which is plastic), do I really have to calibrate (macbethcal) the picture map?

Maybe I show you an example:

···

--
# porphyry red 1: values from ximage and macbethcal'ed pic
void plastic porphyry_red_1
0
5 .09 .06 .05 .02 0

# non-calibrated normpat'ed pic
void colorpict sophia_porphyry_red_1_pattern
13 noop noop noop sophia_porphyry_red_1.pic picture.cal tile_u tile_v -s .2 -rx 90 -rz 90
0

# give alias the modifier as output from dxf2rad
sophia_porphyry_red_1_pattern alias l_porphyry_red_1 porphyry_red_1
--
Will this be correct?

TIA, CU Lars.
--
Lars O. Grobe
[email protected]

Hi Lars,

Here is what I understood as the problem from your first message:

The background: I try to use exact data for material definitions, but the image maps can't all be color corrected. So I want the overall color and brightness from defined materials, e.g. from the plastic material, and use the map only for what I would call "local color variation". The reason is that I have e.g. red marble, got its color, brightness and all that defined as plastic marble. But the marble has blue particles which won't appear if I use a grayscale imagemap. So I want to use a normpat'ed (NOT colorcorrected e.g. by macbethcal!) to bring these blue parts onto the surface. The whole surface however must still have the average color of my plastic marble material.

You want to take an image of a material (that has multiple colors in the image) and map this to geometry in some calibrated manner. But the problem is how to do this with a material/image that has multiple colors in it, such as red marble with blue flecks. Because the image has multiple colors you do not want to use the average color of the material for the definition instead you want to use the photopic reflectance value. You want to let the colorpict convey the color information of the image and the plastic to govern the overall reflectance of the material. Thus you should calibrate (macbethcal) the material and normalize (normpat) it.

So I think that you example should be as follows:

# porphyry red 1: values from ximage and macbethcal'ed pic
# rgb = .09 .06 .05
# photopic reflectance = .0673 as determined with grey(.09,.06,.05) in calc
void plastic porphyry_red_1_reflectance
0
5 .0673 .0673 .0673 .02 0

# calibrate the image with macbethcal to get the colors "corrected"
# normpat the image to make its average 1.0
# not sure about the use of noop?
void colorpict sophia_porphyry_red_1_pattern
13 red green blue sophia_porphyry_red_1.pic picture.cal tile_u tile_v -s .2 -rx 90 -rz 90
0

# apply the material
# give alias the modifier as output from dxf2rad
sophia_porphyry_red_1_pattern alias l_porphyry_red_1 porphyry_red_1

Thus you have a base material that is a grey plastic. The reflectance of this material is equal to the photopic reflectance of your sampled material. The rgb color properties are multiplied by the color picture supplied in colorpict. Since the picture is corrected the colors should have a stronger basis in reality (assuming the sampling method is correct). Since the picture is normalized to an average of 1.0, the multiplication of the image by the plastic still equals the reflectance of the material. Since the base material is neutral (eg grey/white) the colors of the image pattern will be what you want.

I hope this is right and if not some one should jump in and correct me.

-Jack

Lars O. Grobe wrote:

···

Hi Jack,

thank You for the reply.

2. final reflectance set by base material - colorpict is used to modify reflectance set by material, that is normpat image colorpict modifier is used to modify reflectance set by material

I want to do this, I have the material values, the colorpict is just to add some visual credibility :wink: But I also want to have the final overall (that means the average over the whole surface, like selecting an area in ximage vs. a point) color from the base material.

So steps as follows:

1. acquire sample material image by photography, scan....
2. callibrate sample image with macbethcal
3. use callibrated sample image to estimate average color
4. calculate reflectance based on average color values, grey(r,g,b)
5. normpat the callibrated image

So, if I already have the rgb for the base material (which is plastic), do I really have to calibrate (macbethcal) the picture map?

Maybe I show you an example:
--
# porphyry red 1: values from ximage and macbethcal'ed pic
void plastic porphyry_red_1
0
5 .09 .06 .05 .02 0

# non-calibrated normpat'ed pic
void colorpict sophia_porphyry_red_1_pattern
13 noop noop noop sophia_porphyry_red_1.pic picture.cal tile_u tile_v -s .2 -rx 90 -rz 90
0

# give alias the modifier as output from dxf2rad
sophia_porphyry_red_1_pattern alias l_porphyry_red_1 porphyry_red_1
--
Will this be correct?

TIA, CU Lars.
--
Lars O. Grobe
[email protected]

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
# John E. de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Hi Jack, Lars

> I hope this is right and if not some one should jump in and correct me.

Ok, lets jump into the ring :slight_smile:
Hmm, maybe Lars want three things at once:
1) get the physics right
2) preserve the average color appearance of the material base
3) add the additional color variation from the map without disturbing 1+2 in the average..

Maybe this is too much?? Jacks version sounds very solid from a scientific point of view, photopic brightness is preserved, and the output is understandable, because of the neutral grey base the colors come out like in the color map in a predictable way. But the original color appearance of the base material is lost completely.

On the other hand, multiplying a color pattern onto a colored base will hardly ever produce anything which one expects at first glance, an extreme example: if you have a red base with r/g/b = 0.2 / 0.02 / 0.0 you can multiply in maps like mad and will never get something blue into the picture.

I think that Lars wants some sprinkles and streaks and dots of blue added to the base here and there, but so little in covered surface, that the average color and thus the brightness of the base does not suffer much.

What about the following: (yeah, again one of my weird ideas:-) edit the picture (resp. the red parts of it) with some color tool in an image manipulation program like Gimp such that the average rgb values for the dominating parts of the pic are those of the plastic description, then it could be used as colorpict to a new plastic with rgb=1/1/1. This new combination will more or less have the same color (in the spatial average) as the original base material, but still look like the pattern.

-cb

Hi!

Ok, lets jump into the ring :slight_smile:
Hmm, maybe Lars want three things at once:
1) get the physics right
2) preserve the average color appearance of the material base
3) add the additional color variation from the map without disturbing 1+2 in the average..

Yes!!!! That is what I was not able to describe ;-)))

On the other hand, multiplying a color pattern onto a colored base will hardly ever produce anything which one expects at first glance, an extreme example: if you have a red base with r/g/b = 0.2 / 0.02 / 0.0 you can multiply in maps like mad and will never get something blue into the picture.

Yes, this is true, I was just guessing that it can't be that easy :wink:

I think that Lars wants some sprinkles and streaks and dots of blue added to the base here and there, but so little in covered surface, that the average color and thus the brightness of the base does not suffer much.

That (the average) is necessary, while the details (e.g. those famous sprinkles and streaks and dots would be nice).

What about the following: (yeah, again one of my weird ideas:-) edit the picture (resp. the red parts of it) with some color tool in an image manipulation program like Gimp such that the average rgb values for the dominating parts of the pic are those of the plastic description, then it could be used as colorpict to a new plastic with rgb=1/1/1. This new combination will more or less have the same color (in the spatial average) as the original base material, but still look like the pattern.

In fact, I hoped that this could be somehow done with the radiance tools in a script, I just don't know how. It's similar to what normpat is doing, only it doesn't normalize to 1/1/1, but to R/G/B values I know as the average material color (->brightness). I think I will have to take a look at normpat to find out how it does that in detail - would be a nice tool if it could bring pictures to (known) color values.

Thanks, CU Lars.

···

--
Lars O. Grobe
[email protected]

Lars O. Grobe wrote:

In fact, I hoped that this could be somehow done with the radiance tools in a script, I just don't know how. It's similar to what normpat is doing, only it doesn't normalize to 1/1/1, but to R/G/B values I know as the average material color (->brightness). I think I will have to take a look at normpat to find out how it does that in detail - would be a nice tool if it could bring pictures to (known) color values.

somehow, it sounds feasable, but this is certainly one of those ideas which prove themselves more difficult in implementing them as one thinks at the beginning. You probably won't get away without some manual interaction, e.g. deciding which color-ranges to convert.

BTW, if it is not so important to use exactly that picture, but just to have a marble stone pattern, you might try out the procedural stone color patterns I've provided in my 2002 workshop contribution (available on the radiance-online site). Here you can set the rgb values of the color-map explicitely to the ones you need.

-cb

···

Thanks, CU Lars.
--
Lars O. Grobe
[email protected]

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general