Hi Michel-
The LUT table expected by wpic is a [3,256] shape byte piddle.
One way to get that from your current piddle data values:
pdl> $lutd = cat($r,$g,$b)->mv(1,0);
pdl> p $lutd->info
PDL: Float D [3,256]
pdl> $lut = byte(255 * $lutd);
pdl> p $lut->info
PDL: Byte D [3,256]
pdl> p $lut->minmax
0 255
after which the wpic should work:
pdl> wpic($image,$file, {LUT =>$lut})
writing rawformat with magic P6
Hope this helps,
Chris
On Mon, Jan 4, 2016 at 12:24 PM, Michel Combes <[email protected]> wrote:
> Hello all,
>
> I am a newbie at PDL and struggling with getting a mean of visualizing
> output.
>
>
> $lut = pdl lut_data($lutn);
> wpic($image,$file, {LUT => $lut});
>
>
> I am trying to pass option LUT to the wpic call, (see attached script)
>
> Here is the error that I have,
> *expecting (3,x) input at C:/strawberry/perl/site/lib/PDL/ImageRGB.pm line
> 142.*
> * PDL::interlrgb(PDL=SCALAR(0x3bd94b8), PDL=SCALAR(0x3bbc3f8))
> called at sub PDL::IO::Pic::chkpdl line 31*
> * PDL::IO::Pic::chkpdl(PDL=SCALAR(0x3bd94b8), "PNM",
> HASH(0x3bdcee0), "PNG") called at C:/strawberry/perl/site/lib/PDL/IO/Pic.pm
> line 490*
> * PDL::wpic(PDL=SCALAR(0x3bd94b8), "out.png", HASH(0x3bd91e8))
> called at colormap.pl <http://colormap.pl> line 27*
>
> I don’t understand that it expects a (3,x) piddle, how do I get the $lut
> piddle ?
>
> Your help will be greatly appreciated
>
> Thanks
> +Michel
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> pdl-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pdl-general
>
>
------------------------------------------------------------------------------
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general