                   my $v5 = $bit5-&gt;[$w][$h] &lt;&lt; 5;  # Shift to Bit 5
                        $res[$w][$h] = $v7 | $v6 | $v5; # Binary OR
                }
        }
        return \@res;    # Return resulting image
 }</code></pre>

<h1 id="Write-hidden-image-to-file:-PDL::NiceSlice1">4.) Write hidden image to file: PDL::NiceSlice</h1>

<p>The hidden image was a grayscale with size 200x265. So I create an empty PDL object with this size and assign a PDL::NiceSlice of that size from the composed data.