image2cpp
image2cpp copied to clipboard
Download as binary file
Downloading the .bin file and viewing with VS code HexEditor, the .bin does not match the values generated in hex on the GUI.
When "Remove '0x' and commas from output" is selected, the downloaded .bin file is empty.
Downloaded .bin file
GUI output data:
It seems like when using RGB565 all 16bit integers are casted to 8bit which also explains why the downloaded file is only half the size of the generated c array.
Can also confirm the file I downloaded was different to the bytes i got when copy-pasting.
I was able to copy the bytes into a file, and then run
cat image.txt | tr -d '\n' | xxd -r -p > image.bin to fix this.
You can fix this error in the file ./js/script.js in line 1045 replace const data = new Uint8Array(raw); to const data = new Uint16Array(raw);