This is part of the script I use for handling ".nw". If you would like the full script I can send you it, tho it is in PHP not GS1 or GS2.. Still the concepts should work.
PHP Code:
$base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for ( $i=0; $i<64; $i++ ) {
for ($k=0; $k<64; $k++ ) {
$temp = $test[$k][$i];
$tile = dechex(strpos($base64,$temp[0])*64+strpos($base64,$temp[1]));
$tilex = hexdec(substr($tile, 0, -1)) % 32;
$tiley = floor(hexdec(substr($tile, 0, -1))/32)*16 + hexdec(substr($tile, -1));
}
}
In this case Tile would be the base64 to hex value.. Tilex would be the number of tiles left to right on the tileset. And tiley would be up and down. To get the starting pixel of the tile you must multiple the x/y by 16 pixels.