• well i build a MAC16 palette in photoshop as your script does (the online tool)
    now i can export the image "as is".

    the image with the good palette

    Now on my screen, the color does not match.
    what is suppose to be a gray #bbb is purple and the gray #444 is green...
    no matter i change the palette reference by reorganize (in photoshop) the place of each color as in your coded palette...

    oh and i use your palette as the ref palette.
    what's wrong?

    var img = {
      width : 128, height : 128, bpp : 4,
      buffer : require("heatshrink").decompress(atob("m­UzAJIAJmUykMRiAAEiIHDiMiDZQjIGZwAMkURgI5­BABEBgMTFC4AVmJ3EHYgJEU4MSFCqAUn8yOgiAKQ­Ic/DIbFWIxp9BOgL1DAYUARAoJDkY7UPiICBPRQJ­EAgQCBgMCfUpSBkEAHYr/FAAMhQA0Tf8J8BAIMyf­BsRiUSfoQJDgLBBf65+MO4hyCOgYACP4aAFiT/jP­xZyBBgR/CBIgACl7/ikD5HPop/DQAYAEQB4ASfpy­ACP4MiA4KCGf4IBBAAIDDYZJ+Pdoj/LQAILFgCAR­f6JpCQJgNCP4QHEQIZ6LACcwMgRzEAAgLGkQEDBY­kAkaAeNAiADiR8GBIR/FPwkBgSABAIZAXmJ+GAJC­KEkMhPgocBAIJ+cn8hPgb/EAggADPwMSkb9GgCAC­ib+cM4hsFPQqEDkMiP4QKCQAQVBiPzQDUyPwroDA­AJ6CQA0jkSKFQAcRl7/DAIIAUfwoECA4gzEfYIAB­P4KADDIaACYBj/OfwJ8HQwZ6DkUikYACmaAECYSA­CiT9ZmT5GMoR+FPIMyAA0hf4aADCwL/ZfwJ+IBIR­8CPAIAHkUSP4iACiMvBwT/JIBcwO4Z+DA4QuBPYJ­ZKQAQZCDQbAMPxk/fwR7GfQR7BMgM/AAaAGP4QAD­H5r+RPwQBCFgIRE+YBEDgshPogDCkI/Yfw4FBPoJ­6EAA7vETo0AiUvH60xLwh+EkR+HAAJcHQAQfFgLZ­Bf6r+IgMTfIqANkciHQL/DDoS9UmcgPwoABgJWDP­ggAFEA0iEAIhEiS/WG4L+FgB+K/6AKmciEIKADiQ­NDB4aAOLorgCP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AwZBN4Z9DQA6DIP4SBDf­4kQf5h+BfIZ+GOAgaCn5fIPwYDCLYJ/WmJ8CLYoB­BdIZSDQBh/UEYZ+EmS0CLIIABLQcCPwb1CABILDP­gJ/CkIeCEYIlDPwSnBERRUEK4kAfoRRDDRALDQAY­BBkJ/CQIr/OAILUELATXCiT6EAAj/BAIKCGAAciD­oQAFBAcRgR/KA=="))
    };
    
    function draw() {
      digitalPulse(LED2, true, 20);
      g.clear();
      g.drawImage(img,0,0);
      g.flip();
    }
    var g;
    function onInit() {
      A5.set(); // Backlight On
      var colorPalette = new Uint16Array([
      0x000000, 0x444444, 0x888888, 0xBBBBBB,
      0x996633, 0x663300, 0x006600, 0x00aa00,
      0x0099ff, 0x0000cc, 0x330099, 0xff0099,
      0xdd0000, 0xff6600, 0xffff00, 0xffffff]);
      // 2 couleurs pour la palette
      // init spa
      var spi = new SPI();
      spi.setup({mosi:B15 /* sda */, sck:B13 /* scl */});
      g =require("ST7735").connect({
        palette:colorPalette,
        spi:spi,
        dc:A7,
        cs:B10,
        rst:B1,
        // height : 160 // optional, default=128
        }, draw
      );
    }
    
About

Avatar for Mrbbp @Mrbbp started