loadImage('ns-black.png').then(canvas => {
  var cards = sliceImage(canvas, ibbBoxes6);
  var sizes = {};
  _.each(cards, (card, position) => {
    var cardCnv = document.createElement('canvas');
    cardCnv.width = card.width;
    cardCnv.height = card.height;
    cardCnv.getContext('2d').drawImage(card, 0, 0);
    document.body.appendChild(cardCnv);

    var sp = document.createElement('span');
    sp.innerHTML = ` ${position}<br>`;
    document.body.appendChild(sp);

    var size = cardCnv.width + 'x' + cardCnv.height;
    sizes[size] = (sizes[size] || 0) + 1;
  });
  console.log(sizes);
});

@@ -1,8 +1,24 @@
+Promise.all(%5B%0A  
 loadImag
@@ -38,20 +38,68 @@
 ng')
-.then(canvas
+,%0A  loadImage('ns-red.png')%0A%5D).then((%5BblackImage, redImage%5D)
  =%3E 
@@ -111,16 +111,26 @@
 ar cards
+BlackNorth
  = slice
@@ -135,22 +135,81 @@
 ceImage(
-canvas
+blackImage, ibbBoxes6);%0A  var cardsRedNorth = sliceImage(redImage
 , ibbBox
@@ -218,496 +218,768 @@
 6);%0A
+%0A
   var 
-sizes = %7B
+nsBlackSuits = %7BN: 'S', E: 'D', S: 'C', W: 'H'%7D;%0A  var nsRedSuits = %7BN: 'H', E: 'C', S: 'S', W: 'S'
 %7D;%0A
+%0A
   
-_.each(cards, (card, position) =%3E %7B%0A    var cardCnv = document.createElement('canvas'
+var cardsNS = %5B%5D;%0A  var cardsEW = %5B%5D;%0A%0A  var recordCard = function(card, position, isNorthBlack) %7B%0A    var player = position%5B0%5D;%0A    var rank = Number(position.slice(1)
 );%0A    
-cardCnv.width
+var el;%0A    if (isNorthBlack) %7B%0A      el
  = 
+%7B
 card
-.width;%0A    cardCnv.height
+, suit: nsBlackSuits%5Bplayer%5D, rank: 2 + rank%7D;%0A    %7D else %7B%0A      el
  = 
+%7B
 card
-.height;%0A    cardCnv.getContext('2d').drawImage(card, 0, 0);%0A    document.body.appendChild(cardCnv);%0A%0A
+, suit: nsRedSuits%5Bplayer%5D, rank: 2 + rank%7D;%0A    %7D%0A    if (player == 'S' %7C%7C player == 'N') %7B%0A      cardsNS.push(el);%0A    %7D else %7B%0A  
     
-var sp = document.createElement('span');%0A    sp.innerHTML = %60 $%7Bposition%7D%3Cbr%3E%60;%0A    document.body.appendChild(sp
+cardsEW.push(el);%0A    %7D%0A  %7D;%0A%0A  _.each(cardsBlackNorth, (card, position) =%3E %7B%0A    recordCard(card, position, true
 );%0A
-%0A
   
-  var size = cardCnv.width + 'x' + cardCnv.height;%0A    sizes%5Bsize%5D = (sizes%5Bsize%5D %7C%7C 0) + 1
+%7D);%0A  _.each(cardsRedNorth, (card, position) =%3E %7B%0A    recordCard(card, position, false)
 ;%0A  %7D);%0A
   co
@@ -974,16 +974,17 @@
 ;%0A  %7D);%0A
+%0A
   consol
@@ -993,13 +993,50 @@
 log(
-sizes
+%7B%0A    'EW': cardsEW,%0A    'NS': cardsNS%0A  %7D
 );%0A%7D

Generate reference images