#!perl

use PDL;

use PDL::Graphics::LUT;
use PDL::Graphics::Gnuplot qw(image);

my @tables = lut_names();
printf "%s\n.\n",join(',',@tables);


# ----------------------------------
# data ...
my $img = rfits('fixed_gal.fits');
$image = byte($img*255/max($img));
image $img;
# ----------------------------------

my $lutn = 'aips0';
($l,$r,$g,$b) = lut_data($lutn);
# doesn't work !
$lut = pdl lut_data($lutn);
printf "lut %s\n.\n",$lut->info;

# ----------------------------------
my $file = 'out.png';
wpic($image,$file, {LUT => $lut});
# ----------------------------------

1;
