RE: textures too dark (fix script included)

New Message Reply Date view Thread view Subject view Author view

From: Curtis Lisle (clisle++at++sgi.com)
Date: 01/22/2002 12:01:56


 
Friends,
There have been a couple messages about textures being too dark once files
are converted over from IRIX to PC platforms. In my experience, the default
gamma of Octane/Onyx systems is 1.7 while the default PC gammas is 1.0.
This will make databases and movies noticably darker.

Enclosed below is a script that uses the ImageMagick freeware software for
IRIX to brighten an entire movie file. It breaks out the movie to images,
brightens each image, and re-assembles the movie. You can adopt this script
to work on databases using the following approach:

#!/bin/csh
cd directory with database textures
mkdir ../bright
foreach i (*.rgb)
  brighten image and copy to ../bright/$i
end

this will create a directory next to the original with brighted images. YOu
can then copy the new textures and the geometry files together to "brighten"
the database. This can largely automate the adaptation of large databases.
Good luck!

Following is the movie conversion script I mentioned...

----- cut here ---------------

#!/bin/csh
#
# script to update the gamma value of a movieplayer file
#
# Curtis Lisle
# SGI
#
# The default behavior is to increase the gamma of all files
# so that a movie created on an Onyx2 or Octane (gamma 1.7)
# displays well on a PC (gamma 1.0).
#
# Usage: fixMovieGamma original.movie
#
# The movied file called 'original.movie' will be brightened and
# written out as 'fixed.movie'. The original movie will not be
# be deleted.
#
# NOTE: several different types and rates of movie files exist,
# some switch settings may vary on dmconvert. Examine your
# movie files with 'dmconvert -D <moviefile>' to see a description
# of your movie. In particular, compression options and rate may
# need to be specified when the movie is reconstructed from image
# files
#

# create temporary directories for the original and the fixed images
set dirname=`date +%m%d%m_%H%M`
set origdir=`echo $dirname`_orig
set fixdir=`echo $dirname`_fix
#echo $dirname $origdir $fixdir
mkdir $origdir
mkdir $fixdir

# break out the movie into separate files
echo 'breaking out the movie into separate files'
dmconvert -f rgb -p video -n out\#.rgb original.movie $origdir/out\#.rgb

# adjust the gamma on each individual frame of the movie
# using the convert tool from the ImageMagick library available
# from the SGI freeware webpage

# temporarily reset the directory. The redirection sends the
# directory info to /dev/null so the script doesn't print anything but
# the echo statements

echo 'fixing gamma one frame at a time'
pushd $origdir >>&2
foreach i (*.rgb)
  /usr/freeware/bin/convert -gamma 1.7 $i ../$fixdir/$i
end
popd >>&2

# remove original frames to save space
echo removing original frames to save space
rm $origdir/*.rgb

# put the movie back together
# Note that you need to specify a rate if the original rate wasn't 30.0Hz.
# Rate is specified by changing 'video' to 'video,rate=3.0' for 3Hz.

# You can specify the type of movie file to create by using qt=quicktime,
# sgimv=sgimovie, avi=AVI movie, mpeg1s=MPEG1 systems, mpeg1v=MPEG1 video

echo 'creating a new movie from the fixed frames'
dmconvert -f mpeg1v -n out\#.rgb -p video $fixdir/out\#.rgb fixed.movie

# remove the temporary directory
echo 'removing the temporary directories'
rm -r $origdir
rm -r $fixdir


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jan 22 2002 - 12:00:56 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.