if { $argc != 2 } {
    puts "Usage $argv0 imgName brushName"
    exit
}

package require poImg

set imgName [lindex $argv 0]
set bshName [lindex $argv 1]

set img [poImage NewImageFromFile $imgName]
$img GetImageInfo w h a

poImgUtil SetFormatRGB $OFF $OFF $OFF
poImgUtil SetFormatChan $BRIGHTNESS $FLOAT
set bsh [poImage NewImage $w $h]

$bsh CopyChannel $img $RED $BRIGHTNESS

$bsh WriteImage $bshName po cg1
exit
