Create constant radiance image

Hi,

Happy New Year to all members and their families!

Is there some easy 'one command' way to create Radiance image with all
pixels set to some constant value?

Equation like this works, where in dat file are listed pixel values
pvalue -r -h +Y 9 +X 5 -d pixel_file.dat > uniform_image.hdr

But I need images of various resolutions, so not much sense to create dat
file with 1024x1024 or so, equal pixels as input for pvalue.

Is there some way to give some constant radiance value and resolution on
input of pvalue or some other program to create such images?

I tried creation of small image as above and then make it bigger with pfilt,
but if image is completely black (all 0 pixels) for example, pfilt can't
filter it.

Thanks,
Marija.

This script below may be on the right track. Save it as "pblank", make
it executable, and put it in /usr/bin or wherever. It'll make a X by Y
image with all pixels having value of VALUE. It requires Python to be
installed, by the way.

--Dave

#! /bin/bash

# pblank - make an X by Y Radiance HDR image with all pixels having
values of VALUE

···

#
# Usage:
#
# pblank [x] [y] [value] > outfile
#
# by David Smith, July 2009

echo "print('$3 $3 $3 \n' * $1 * $2)" | python | pvalue -di -d -r -h
-H -y $2 +x $1

Hi Dave,

Thanks for idea!

I'm in fact using Python and trying to include in my code, generation of
such images.
I didn't know that command:
print "a" * X
in Python, will print string "a", X times; so your idea will help me a lot.

Thanks again,
Marija

···

On Tue, Jan 5, 2010 at 4:07 PM, David Smith <[email protected]> wrote:

This script below may be on the right track. Save it as "pblank", make
it executable, and put it in /usr/bin or wherever. It'll make a X by Y
image with all pixels having value of VALUE. It requires Python to be
installed, by the way.

--Dave

#! /bin/bash

# pblank - make an X by Y Radiance HDR image with all pixels having
values of VALUE
#
# Usage:
#
# pblank [x] [y] [value] > outfile
#
# by David Smith, July 2009

echo "print('$3 $3 $3 \n' * $1 * $2)" | python | pvalue -di -d -r -h
-H -y $2 +x $1

Hi Marija,

You could do this with pcompos. The -b option is used for specifying the
radiance:

pcompos -x 1200 -y 800 -b r g b

Basically, you're using pcompos but not composing anything but a background,
the color of which is specified with that -b option.

- Rob

···

On 1/5/10 4:56 AM, "Marija Velickovic" <[email protected]> wrote:

Hi,

Happy New Year to all members and their families!

Is there some easy 'one command' way to create Radiance image with all pixels
set to some constant value?

Equation like this works, where in dat file are listed pixel values
pvalue -r -h +Y 9 +X 5 -d pixel_file.dat > uniform_image.hdr

But I need images of various resolutions, so not much sense to create dat file
with 1024x1024 or so, equal pixels as input for pvalue.

Is there some way to give some constant radiance value and resolution on input
of pvalue or some other program to create such images?

I tried creation of small image as above and then make it bigger with pfilt,
but if image is completely black (all 0 pixels) for example, pfilt can't
filter it.

Thanks,
Marija.

The <return> option of ximage seems to give the maximum radiance in any one channel rather than the RGB weighted value, whereas the 'l' option gives the expected (RGB weighted) luminance value. The -ov option reports correctly. Anyone else see this?

Version RADIANCE 4.0a lastmod Fri 30 Jan 2009.

-John

···

-----------------------------------------------
Dr. John Mardaljevic
Reader in Daylight Modelling
Institute of Energy and Sustainable Development
De Montfort University
The Gateway
Leicester
LE1 9BH, UK
+44 (0) 116 257 7972
+44 (0) 116 257 7981 (fax)

[email protected]
http://www.iesd.dmu.ac.uk/~jm

Hi John,

You are correct -- weighting values are not applied for the <return> reporting in ximage, corresponding to the radiant "intensity" for this pixel or area. There is no agreed-upon weighting for radiance values, only luminance, which is the reason for the different choices. You can always divide the 'l' report by 179 if you want a photometrically-weighted radiance quantity. The 'c' command reports the RGB color, but adjusted by the current exposure scale, which is not really useful as a radiometric quantity.

Cheers,
-Greg

···

From: John Mardaljevic <[email protected]>
Date: January 6, 2010 2:06:35 AM PST

The <return> option of ximage seems to give the maximum radiance in any one channel rather than the RGB weighted value, whereas the 'l' option gives the expected (RGB weighted) luminance value. The -ov option reports correctly. Anyone else see this?

Version RADIANCE 4.0a lastmod Fri 30 Jan 2009.

-John

There is no agreed-upon weighting for radiance values, only luminance

Of course (duh)! I get so used to working between irradiance and illuminance using luminous efficacy models that I occasionally forget some of the R(r)adiance basics. Nonetheless, to avoid confusion in the future, might I suggest an update to the ximage manpage? Perhaps something like:

<return> Display the mean RGB radiance averaged over the area of interest. [For a single value, the mean seems less arbitrary than the maximum value for any one of the channels. Otherwise, some indication of what the current behaviour is.]
l Display the photometrically-weighted RGB luminance value in the area of interest. This assumes that the image was correctly computed in terms of luminance.
Then again, if I'm the only person who's been bamboozled by this, it's probably not worth the mods to the man page.
-John

···

-----------------------------------------------
Dr. John Mardaljevic
Reader in Daylight Modelling
Institute of Energy and Sustainable Development
De Montfort University
The Gateway
Leicester
LE1 9BH, UK
+44 (0) 116 257 7972
+44 (0) 116 257 7981 (fax)

[email protected]
http://www.iesd.dmu.ac.uk/~jm

Hi John,

I updated the ximage man page with the current behavior, which is to take the peak of the three channels for reporting of radiance.

Cheers,
-Greg

···

From: John Mardaljevic <[email protected]>
Date: January 6, 2010 11:13:32 AM PST

There is no agreed-upon weighting for radiance values, only luminance

Of course (duh)! I get so used to working between irradiance and illuminance using luminous efficacy models that I occasionally forget some of the R(r)adiance basics. Nonetheless, to avoid confusion in the future, might I suggest an update to the ximage manpage? Perhaps something like:

<return> Display the mean RGB radiance averaged over the area of interest. [For a single value, the mean seems less arbitrary than the maximum value for any one of the channels. Otherwise, some indication of what the current behaviour is.]
l Display the photometrically-weighted RGB luminance value in the area of interest. This assumes that the image was correctly computed in terms of luminance.
Then again, if I'm the only person who's been bamboozled by this, it's probably not worth the mods to the man page.
-John