use strict; use warnings; use 5.020; use PDL; use PDL::IO::Image; use PDL::Image2D; use PDL::IO::FastRaw; use Encode qw/ decode /; my $img = PDL::IO::Image-> new_from_file( 'test.png' ); my $pdl = $img-> pixels_to_pdl-> short; my $s1 = cc8compt( $pdl == 0 )-> byte; my $s2 = cc8compt( $pdl == 0 ); say 'Equal' if decode( 'UTF16LE', ${ $s2-> get_dataref }) eq ${ $s1-> get_dataref }; writefraw( $s1, "fname-1" ); writefraw( $s2, "fname-2" );