• The issue is that when you create a 4 bit graphics, I believe it maps the colors values right through - but when you draw the image, 4 bits is treated as the Mac color palette.

    The easiest thing to do is to supply a palette when drawing your 4 bit buffer:

    let buf = Graphics.createArrayBuffer(120, 120, 4, {msb:true});
    let bufimg = {
      with:120, height:120, bpp:4, palette = new Uint16Array([...]), buffer:buf.buffer
    }
    
    g.drawImage(
      bufimg,
      0,
      0,
      {scale: 2}
    );
    

    and that might sort you out...

About

Avatar for Gordon @Gordon started