I suspected result on Linux be wilder than "wrong_setup" because terminals are almost certain to use palette, not pure RGB. "Security"? Life corrects as always.
################################## ########### Deal with image ################################## use PDL::IO::FlexRaw; my $image; { my $im = Imager-> new( file => $image_file ) -> to_rgb8 -> convert( preset => 'noalpha' ) -> scale( xscalefactor => 1, yscalefactor => 1 / $distortion ); my $w_r = $cols / $im-> getwidth; my $h_r = $rows / $im-> getheight; my $ratio = $w_r < $h_r ? $w_r : $h_r; $im = $im-> scale( scalefactor => $ratio ) if $ratio < 1; $im-> write( data => \my $buf, type => 'raw' ); my $dims = [ 3, $im-> getwidth, $im-> getheight ]; open my $fh, '<:raw', \$buf; $image = readflex( $fh, [{ Type => 'byte', Dims => $dims }]) }
TIMTOWTDI. One reason to use PDL::IO::Image was to play with its rescale filters (which amounted to nothing) to average glyph bitmap to single pixel. In the end it's arithmetic mean with Imager::scale(qtype => 'mixing',... and itself not necessary neither, could be unpack '%32C*', ...
(Another reason for PDL::IO::Image was to use the best what happened to image IO and basic manipulation, for PDL if not Perl. Very sad if it's abandoned. PDL::IO::GD and PDL::IO::Pic don't compare)
In reply to Re^4: Imagecat - show color images in a terminal
by Anonymous Monk
in thread Imagecat - show color images in a terminal
by cavac
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |