About
falsecolor2 is a Python rewrite of the falsecolor csh script in the Radiance distribution. The main purpose was to have a falsecolor script for Windows but I added a few extra bits on the way.
wxfalsecolor is a graphical frontend to falsecolor2. It also implements a few features of ximage so it can be used to display Radiance RGBE images and read luminance/illuminance values.
As with the original script falsecolor2 relies on the Radiance image tools which you need to have installed on your system.
Features
falsecolor2 supports all the features of the original falsecolor. I have added a few new features and some original features behave a bit differently:
- The formatting of the default legend is different.
-cb creates a falsecolor image of discreet colours instead of an obese variation of contour lines.-h shows a summary of the command line options. This option does not create an image but prints a help message to stdout (terminal).-lp allows you to specify the legend position; legends above and below the image are horizontal instead of vertical.-mask <minvalue> masks all values below minvalue with the background color (black).-z creates legends starting at 0- new in v0.3:
-s auto option for automatic legend scale adjustment
With wxfalsecolor you can
- load and display Radiance RGBE images
- display RGB and Lux values (even after conversion to
falsecolor image) - set
falsecolor2 options interactively - drag-and-drop images in a desktop environment
- set
pcond options interactively - display labels for spot and average pixel values (like
ximage) - save image as bitmap
- view image headers
Windows binary package
If you intend to use wxfalsecolor or falsecolor2 on Windows you can download a binary executable that includes all Python dependencies. You still need Radiance, though. These are not an installers, just plain executables.
If you are familiar with SVN you can get the current source files via svn checkout:
svn checkout http://pyrat.googlecode.com/svn/tags/wxfalsecolor/0.3 wxfalsecolor_v0.3
or
svn checkout http://pyrat.googlecode.com/svn/trunk/wxfalsecolor wxfalsecolor_current
Alternatively you can download the most recent files as a zip archive from this address:
Both URLs assume that version 0.3 is still current. It's worth to check the repository listing first in case I haven't updated this web page.
Installation
Requirements
Radiance
Obviously you need Radiance. You can download binaries for OS X and sources from the Radiance home page. For Windows I recommend to use Francesco Anselmo's MinGW binary package. Debian and Ubuntu users can install Radiance packages from the repository
Python
If you want to use the Python source files you have to download and install Python and wxPython on your machine before you can use the script. OS X has Python already installed as part of the system installation. Just select a wxPython version that matches your Python version.
Other (older) versions of Python will work, too. For packaging on Windows I have to use Python 2.5, so that's what I use for the development on Windows. You do need wxPython 2.8 or younger, though.
Environment Settings
wxfalsecolor as a desktop application requires that the Radiance tools are found in your desktop's environment search path. You have to extend your search path to include the installation of your Radiance binaries.
Windows
On Windows do the following:
-> "Start" menu
-> right click on "My Computer"
-> select "Properties ..." in the popup menu
-> select the "Advanced" tab
-> select the PATH variable in either the user or system settings
-> click "Edit"
-> modify the path to include your Radiance installation
OS X
On OS X you need a configuration file that sets your desktop environment. This file is an XML file named ~/.MacOSX/environment.plist. It does not exist by default so if you had no need for it before you have to create it. Create the file and add following content
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PATH</key>
<string>/usr/local/bin</string>
</dict>
</plist>
This assumes that you have Radiance installed in /usr/local/bin. With this file in place every application you start from your desktop will have the PATH environment variable set to /usr/local/bin.
Linux
Debian and Ubuntu have a /etc/environment file where you can set the environment. Other Linux distributions will have something similar.
Start the application
Binaries
falsecolor2 is a command line tool. By default it read data from stdin and prints the falsecolor image to stdout. It is meant to be a drop in replacement for falsecolor so everywhere you would have used falsecolor in your scripts you can now use falsecolor2.
wxfalsecolor: Just download and double-click to use. You can also drag images on the executable to open a new application window.
Python Scripts
Windows only: When you installed Python it should have registered the *.py extension as Python scripts. If this is done you can call falsecolor2.py without the *.py extension or start wxfalsecolor.py by double-click.
On OS X and Linux you have to set the executable bit of falsecolor2.py and wxfalsecolor.py:
chmod +x /usr/local/bin/falsecolor2.py
chmod +x /usr/local/bin/wxfalsecolor.py
Optionally you can remove the *.py extension if you don't want to type it all the time. Then start the terminal or cmd prompt and type:
The main window of wxfalsecolor should pop up now. If nothing happens try the full path. If that works your PATH setting does not contain the installation location.
/usr/local/bin/wxfalsecolor.py
Usage
The script can take an image as a command line argument, so you can use it like ximage.
The application window will start in a default size. There is no need to resize a particularly large image that wouldn't fit on the screen.
Control Panel
The control panel on the left side shows all the available action and option buttons. It's has three static buttons (open, save and quit) and alternately visible folding panels dedicated to a particular task.
To open a new image press the "open HDR" button and browse for the image or just drag the image in the right picture panel.
You can save the (new) image as BMP, PPM, TIF or HDR image. This "save image" button will save the HDR image produced by pcond or falsecolor2. It can be converted to another format but the size will be based on the size of the input image, not the currently displayed image. I. e. an image that is 3000px wide and displayed in a 800px wide window will be saved with the full 3000px.
Note on saving different image formats: On Windows the format will be determined by the extension of the new image name while on OS X the appropriate extension is appended to the filename. So if you name your new file "image.jpg" and select "BMP" as file format you will get a BMP called "image.bmp" on Windows and a BMP called "image.jpg.bmp" on OS X.
Display Features
Under the "display" foldout panel you can find the "load data" button. If you want to show pixel values as labels on the screen you have to click this button first to load the pixel data into memory. This can take a while, especially for large images. After that the button will be relabeled to "clear labels" and you can use it to remove all the labels you have placed on the screen so far.
Placing labels: Once the data is loaded you can click on the image and a label with the corresponding Lux value will be displayed on top of the image. (There is no way to modify the label yet). You can also click and drag on the image to display the average pixel value. Note that pixels which are completely black (red == 0) will not be counted in the average.
The "save bitmap" button allows you to save a copy of the screen image to a file. This image will be the same size as on the screen and it will show all the labels you have currently displayed.
Below you have a block of options to modify the display of the HDR image using pcond. Whenever you change an option the "apply pcond" button will be highlighted to show that the options do not correspond to the displayed image.
Falsecolor Features
Once you have opened an image you can set options for the falsecolor2 conversion. When you press "convert" (or "update fc" after that) the image will converted and the result displayed.
Misc
Unter the "misc" foldout you can find a button to show the header of the Radiance image. If you have modified the HDR image the new header of the new image will be shown, too. Here you can find for example the new exposure value of the image.
The "about" button displays information of the application itself, which includes also the version number.