I have 4 diffetent types of image data. 3 of them are in SVG format and one is in bitmap. I have converted SVG->BangleJS using this, and Bitmap->BangleJS using this
1- Bitmap
var img =
require("heatshrink").decompress(atob("oNDyBC/AH4A/AH4A/AH4A/AH4A/AGlVnltzpD/AG887gBLJv4Avtu9P5oBDqs8Kv4AFqtcon8sudf9oBHPf4ABst9Jsp/VQf5/CvhNnQP7/hJ76BZrtcP/6Djst8QLK1ZADtdKbQvTFrNdnh/0rjTbQaavtAD9Vnh/dK6aB/P75hTQcp/xpp/UMKo5NtudEKJNBP+EcM7bhhf/9E/hjfDp4xBY6tlvp9xP8aDTNOYAVPqJdXQP4AVtudP86DPPP7XVLMJ//QMJP/AGNVnh//AH4ABPo9NjhJ/AHdt3o31rt8PP4A9P4M87hD/P/6B/P/6B/P/6B/P/6B/AHp/JALZl/QP6D/MpKB7pscP/6DXQM9dviB/Qa6BnP/JjRD57dBPr9lvp/7cqZP9Qf6D/Qf6D/ONqD/P/6D/P/6D/P/6D/P/5hdQf5//Qf5//Qf5//Frdlvh//P9dVngtRpscP/5/pFaIBDtu9P/5/lPqqxdP/59jP/5NjPrdtzp//P79Nnh9ZrtcPvZ/lPrKZBPvp/9on8Pv5/lQK57/P9InpP/5XZrt8Pv4ATtuda9dlvojFsudO/4AJP9YA/ACttzp//AH4ABP/4A/AAdtzp9Bst8Iv4A/AH4A/AH4A5"));
2- SVG - Int Array
var polyImg = [
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("PQg9CzsNOA82DzMOMA0vCi4ILwUxAjMBNgA5ATsCPQU9CA==")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("KxMsECsOIQQeAxsEDxEOEw8WEhcUFh4LJhMoFCsT")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("OhwuHC4VKBwoICkhKiI6IjwhPR88HToc")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("ATwEPQY8GSkUJAE3ADoBPA==")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("Hx4cHRoeGCEaIyMtGDMWNRY4GTobOSoxLC4rKw==")))},
{fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))}
];
2- SVG Float32 array
var polyImgF = [
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("NlB1Qlon8kAf4XJC8VYoQWL1a0ISz09BkLhhQiAfaUFbgVdCG09wQVCwS0LAkmZBUNJBQsrjSkFvfjtCg/AhQX+yOUJaJ/JAgiE8QgSfk0AfDUNCDl4JQO9JTULSfxA/W4FXQoYf7D0sUmNCrUQ5PzQwbULyCh1AN4RzQvlroEA2UHVCWifyQA==")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("jgQrQm9BlUEUSC9C1qp+QfEKK0LgRVhBBNgFQnD0hkCjIPJBMbQ+QFCP20FAHYdAgDxvQWO4hUFbWV5B6o6bQeJ4b0Hf1q5B+JKNQXJIt0FzxaBBK86uQVKl80GZ3DdBlYAWQiNKlUFfayFCtrudQY4EK0JvQZVB")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("2IloQn5a3kF/sjlCflreQX+yOUIGQatBwyUgQn5a3kHEJSBCWjkAQp40IkIgwwVCAqooQvu5CEJDj2hC+rkIQmOZcUL09ARCNVB1QmXc90Evi3FCJMjlQdiJaEJ+Wt5B")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("yv+HPxp7cULMbHNA1b11QnKCxkB9gXFCnTnJQf20JUL9GKBBNiURQq90hz+J9VxCrpSBOyXhZ0LK/4c/GntxQg==")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("Bo/1Qd7K8kFFp99Bak3qQZ5kzEGZ0/JB4O/DQZRZBEJVbcxB0PYNQjWJC0IHRDNCPnC8QWhqS0LN3K5BPDVUQgvbskEgQWBCzsHFQZIuZ0IrhdpBnpllQuWBKEIXfUVCD+kwQv3yOELUECxCBqsqQg==")))},
{fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))}
];
My question is, what would be the best option to save RAM considering I am storing the image data in files and reading then using Storage module. I know that option 1 is not the best one but I just listed because I have it.
I am getting the best rendering output when using Option 1 or 2
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi,
I have 4 diffetent types of image data. 3 of them are in SVG format and one is in bitmap. I have converted SVG->BangleJS using this, and Bitmap->BangleJS using this
1- Bitmap
2- SVG - Int Array
2- SVG Float32 array
3- Regular Array
My question is, what would be the best option to save RAM considering I am storing the image data in files and reading then using Storage module. I know that option 1 is not the best one but I just listed because I have it.
I am getting the best rendering output when using Option 1 or 2