first we need to change the PDL object into an array. This we do with exchanging the order of the dimensions with <code>PDL xchg(0,2)</code> and with <code>PDL unpdl()</code> function.</p>

<p>Also for the Array-Solution we implemented a <code>rgb_array()</code> function that is separating the 3 RGB channels. Than the <code>bit_plane_array()</code> function is creating the Bit Planes.</p>

<pre><code> my $tmp1 = $image{data}-&gt;xchg(0,2);
 $image{array} = $tmp1-&gt;unpdl;

 @image{ &#39;red&#39;,&#39;green