define(function() {

  'use strict';
  
  return function(resource) {
    if (resource.data.length !== 64) {
      console.error('ics# resource expected to be 64 bytes, got ' + resource.data.length);
      return;
    }
    var img = document.createElement('CANVAS');
    img.width = 16;
    img.height = 16;
    var ctx = img.getContext('2d');
    var pix = ctx.createImageData(16, 16);
    for (var ibyte = 0; ibyte < 32; ibyte++) {
      var databyte = resource.data[ibyte], maskbyte = resource.data[32 + ibyte];
      for (var ibit = 0; ibit < 8; ibit++) {
        var imask = 0x80 >> ibit;
        if (maskbyte & imask) {
          pix.data.set(databyte & imask ? PIXEL1 : PIXEL0, (ibyte*8 + ibit) * 4);
        }
      }
    }
    ctx.putImageData(pix, 0, 0);
    resource.image = {url: img.toDataURL(), width:16, height:16};
  };

});

@@ -1,15 +1,33 @@
 define(
+%5B'mac/palette2'%5D, 
 function
@@ -27,16 +27,23 @@
 unction(
+palette
 ) %7B%0A%0A  '
@@ -668,16 +668,24 @@
 ata.set(
+palette%5B
 databyte
@@ -699,23 +699,14 @@
 k ? 
-PIXEL1 : PIXEL0
+1 : 0%5D
 , (i

Use palette (ics#)