You are reading a single comment by @d3nd3-o0 and its replies. Click here to read the full conversation.
  • Hi - yes, an option to resize images would be pretty neat. I tend to do exactly what you say (manually resize in an external program).

    'Crop' detects areas of the same colour around the edge of the image and cuts them off. Often if you download an icon from somewhere it's got a bunch of padding around the edge, and that strips it off.

    Palette: the issue is Espruino needs to be able to access the palette from RAM, and you're reading the image direct from flash. For small palettes (4 cols) it just stores the palette on the stack, and while I could extend that to 8 colors for 3 bits, at some point you'll complain that 4 bit fails too :)

    Expecting first argument to be an object or a String

    I think you need to check what the argument actually is, but it's likely it couldn't fit the image into RAM in one long block so E.toString just returned undefined.

  • Palette: the issue is Espruino needs to be able to access the palette from RAM, and you're reading the image direct from flash. For small palettes (4 cols) it just stores the palette on the stack, and while I could extend that to 8 colors for 3 bits, at some point you'll complain that 4 bit fails too :)

    I don't really understand. Could you elaborate? The way I see it is that the palette colors are on disk within the image file. I would like to be able to drawImage direct from flash without have to load it into RAM. Is this a bug or feature?

    EDIT: Ah so you are saying that the combined memory usage of storing the palette in RAM means that it can't draw the image? I mean if thats true then it should work for slightly smaller images, I will test it. Also I can't imagine a 3 bit palette taking up that much RAM. 3 bits is 8 colours, so 8 variables or if its 16bit color conversion, 8 x 16 bit, its 4 dwords.

    If it can draw the non-paletted versions from file, it should also the paletted. I see no reason why it should be RAM intensive.

About

Avatar for d3nd3-o0 @d3nd3-o0 started