dumping xglaresrc result to a file

Folks,
I am writing a script that will take a bunch of HDR files and run the glare analysis.
How can I dump the result of xglaresrc to a file (in PNG format, for example)?
By default xglaresrc is calling ximage in the background, so I will end up with a lot of windows. What I want is to capture those pop-up windows and dump it to a file.
Thanks,
Ery

Ery

How much scripting are you willing to do? If you can relate the output
of findglare to the graphic representation in xglaresrc ("use the
source ...") you could reproduce the output with a simple drawing
library like ImageMagick.

Other than that you could create a shell script that

1) starts xglraresrc
2) waits a few seconds for the highlights to appear
3) takes a screenshot of the ximage window with xwd
4) kills ximage/xglaresrc
5) repeat with next image

Regards,
Thomas

···

On Wed, May 26, 2010 at 4:58 PM, Ery Djunaedy <[email protected]> wrote:

Folks,
I am writing a script that will take a bunch of HDR files and run the glare
analysis.
How can I dump the result of xglaresrc to a file (in PNG format, for
example)?
By default xglaresrc is calling ximage in the background, so I will end up
with a lot of windows. What I want is to capture those pop-up windows and
dump it to a file.
Thanks,
Ery

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

Thomas,

Thanks for the suggestions.

I am trying to avoid the first option that you suggested below. I get the impression that it is more difficult. Can you elaborate further?

I tried your suggestion to use xwd. The problem with this route is that both the ximage (which is called by xglaresrc) and the xwd are interactive programs. We end up trying to automate something that is interactive.

The catch is how to select the window to be dumped. The xwd by default asks the user to click on the window to be dumped. I tried to use the HDR file name as the window_name and pass it to xwd. Something like:

$ xwd -name sc01jd_view.hdr -out sc01jd_view.xwd

It works but (1) it assumes that no other window is on top of this window and (2) it captures what is displayed. The first catch means that we cannot do anything else on the computer while the script is working. The second catch means that if the xglaresrc picture is bigger than the monitor (e.g. netbook screen) the picture is actually cut.

For now, I think I can live with that.

Thanks,

Ery

···

On 05/27/2010 03:06 AM, Thomas Bleicher wrote:

Ery

How much scripting are you willing to do? If you can relate the output
of findglare to the graphic representation in xglaresrc ("use the
source ...") you could reproduce the output with a simple drawing
library like ImageMagick.

Other than that you could create a shell script that

1) starts xglraresrc
2) waits a few seconds for the highlights to appear
3) takes a screenshot of the ximage window with xwd
4) kills ximage/xglaresrc
5) repeat with next image

Regards,
Thomas

On Wed, May 26, 2010 at 4:58 PM, Ery Djunaedy<[email protected]> wrote:
   

Folks,
I am writing a script that will take a bunch of HDR files and run the glare
analysis.
How can I dump the result of xglaresrc to a file (in PNG format, for
example)?
By default xglaresrc is calling ximage in the background, so I will end up
with a lot of windows. What I want is to capture those pop-up windows and
dump it to a file.
Thanks,
Ery

Thomas,

Thanks for the suggestions.

I am trying to avoid the first option that you suggested below. I get the
impression that it is more difficult. Can you elaborate further?

I tried your suggestion to use xwd. The problem with this route is that both
the ximage (which is called by xglaresrc) and the xwd are interactive
programs. We end up trying to automate something that is interactive.

ximage is interactive if you have to adjust the exposure of the image
first. I think you could use pfilt on the image first to get a
reasonable exposure adjustment that displays nicely without further
tweaking. A pfilt preprocess will help with oversized image, too.

The catch is how to select the window to be dumped. The xwd by default asks
the user to click on the window to be dumped. I tried to use the HDR file
name as the window_name and pass it to xwd. Something like:

$ xwd -name sc01jd_view.hdr -out sc01jd_view.xwd

It works but (1) it assumes that no other window is on top of this window
and (2) it captures what is displayed. The first catch means that we cannot
do anything else on the computer while the script is working. The second
catch means that if the xglaresrc picture is bigger than the monitor (e.g.
netbook screen) the picture is actually cut.

xwd is only one app to create screenshots. On Linux you have plenty of
other choices. I would have thought the biggest problem would be to
identify the window. If you can use the image name, fine.

As long as you use a screenshot based method you will always have to
keep the screen free of other windows. If you can't find the time to
let the computer run for a while and you need to do this type of
highlighting a few times you should invest some time in a script that
replaces xglaresrc without ximage. It really doesn't seem that
complicated. Initially I even thought it was a shell script ...

You should reduce the size of large images to something that fits on
your screen. Remember to run findglare again on the smaller size
image! xglaresrc uses a fixed text height and if you have a huge image
the text labels will look tiny.

For now, I think I can live with that.

Problem solved then.

Thomas

···

On Thu, May 27, 2010 at 1:25 PM, Ery Djunaedy <[email protected]> wrote:

Yes, Thomas. The solution I have works for now. I still want to look at the other option (the first option you suggested) because I need this to run at least under linux and mac. That solution seem to be more platform independent. I will keep you posted.
Thanks for your help,
Ery

···

On 05/27/2010 06:51 AM, Thomas Bleicher wrote:

For now, I think I can live with that.
     

Problem solved then.

Thomas

Don't forget "ximage -e auto" -- eliminates the need for pfilt.

-Greg

···

From: Ery Djunaedy <[email protected]>
Date: May 27, 2010 6:30:21 AM PDT

On 05/27/2010 06:51 AM, Thomas Bleicher wrote:

For now, I think I can live with that.

Problem solved then.

Thomas

Yes, Thomas. The solution I have works for now. I still want to look at the other option (the first option you suggested) because I need this to run at least under linux and mac. That solution seem to be more platform independent. I will keep you posted.
Thanks for your help,
Ery