Best practice for large 6-bit images?

Hi folks.

With the announcement of the f5, I've been messing about with idea of utilising that glorious screen.
Those 240x240 pixels, and 64 colours need to be exploited!

With the advent of the "FaceIt" app, I thought I'd recreate the idea in the simulator with my own version.

Simple enough, right?
Well, as 64 colours (RGB222, 6-bit) are represented as 8-bit bitmaps internally - they eat a ton of memory! (well, 20% more)

This might not be an issue with the vivoactive, vivoactive HR - but with the f5s @ 218x218, and the f5/x @ 240x240 - memory quickly becomes a problem.
I can't even load a single 240x240 8-bit image, as the simulator easily hits 57.6kb - and we're outOfMemory.

So, the idea is to split the problem (image) up, render to the frame buffer when needed, free resources, and load the next image when necessary.
During "onUpdate()", I'm actually loading, displaying, and uploading different sections of my image in succession.

Here's a video on my take on the solution;
https://gfycat.com/LiveGreedyEgret

Half way though, I toggle debug, and show you how I'm partially rendering the screen;




So, two questions to the experts:

1. Is this a viable method for displaying full screen, full colour images, or is there a performance penalty with loading resources onUpdate()?
2. How does "FaceIt" do it? Does it use 6-bit images?

It would be a lovely idea if CIQ could support bit-packing a 6-bit image, as 2 bits are lost with the internal 8-bit representation.

Cheers.
  • I'm curious, have you tried specifying a color palette for your image?

    I believe that doing this reduces the size of bitmaps with a few colors. Adding palette entries for as many as 64 palette colors might be frustrating, but there is a chance the resource compiler might do something smart.

    I'm pretty sure there will be a performance cost to loading resources in onUpdate() but it doesn't seem that you really have much of a choice. As for what FaceIt does, I'll leave that to the Garmin guys to answer, though I'm willing to bet that they do something special that we don't have access to.

    Travis
  • I'm curious, have you tried specifying a color palette for your image?
    I believe that doing this reduces the size of bitmaps with a few colors.


    I want all my 64 glorious colors on the screen :)

    Adding palette entries for as many as 64 palette colors might be frustrating, but there is a chance the resource compiler might do something smart.


    Have tried this with all 64 entries in <palette/> and we get:

    Failed invoking <symbol>
    Out Of Memory Error


    So, there's no easy way to straight load a 240x240 8-bit image on the f5 in the simulator!
    The vivoactive/hr is a different story, at 205x148 an 8-bit image is only 30kb.

    As for what FaceIt does, I'll leave that to the Garmin guys to answer, though I'm willing to bet that they do something special that we don't have access to.


    Would be interesting to know! At least for now, my framebuffer trick seems to work.
    This also means I can build more complex watchfaces / apps.
  • Here's an interesting tidbit--it sounds like we may be increasing the available memory to watch faces in the future. I don't have a lot of specifics about it yet, but I believe this change is motivated by the sort of trouble Franco encountered with the F5 rendering full color images. :) My assumption is that this will be on F5 devices and newer.
  • Here's an interesting tidbit--it sounds like we may be increasing the available memory to watch faces in the future. I don't have a lot of specifics about it yet, but I believe this change is motivated by the sort of trouble Franco encountered with the F5 rendering full color images. :) My assumption is that this will be on F5 devices and newer.


    Woohoo, that's super exciting!

    When building for the f5x, there's 90kb to play with - easily rendering a 240x240x8 bitmap without a problem.
    Hopefully this makes it's way to the f5/s.

    In the meanwhile, I've posted my code to GitHub if anyone's interested in using this technique in your own projects;
    https://github.com/sunpazed/garmin-vangogh
  • With 90k available for the watchface in sim memory, what is the size of the .prg itself? (debug build but really a release build is what you want) (you can see a release build by using the "Build for device wizard" and put it in a directory on your drive)

    There's a limit on the total size of all the .prg's on devices that's something like 512k or 1m, and it seems while this could use allow things to fit in memory, it could use a bunch of mass storage space.
  • Garmin Face It

    Hello, i don't know if it is linked but "Garmin Face It" previews for fenix 5 are far worse than Chronos ones. Seems like that 64 colors are not usable at the same time in fenix 5 like in chronos.
    It you try to generate a watchface for fenix 5 or chronos, you'll see the big difference.
    Strange!
  • You're absolutely right.

    Here's a few watchfaces built from the same image to showcase skin-tone, and the rendering of many colours:



    The Fenix Chronos is the best of the bunch.
    You especially notice it with the skin tone, the yellow patch on the right, and the pink soft toy.

    It seems that the Fenix5 and 5s uses the exact same colour depth (16 colours) and palette as the Fenix3, while the Chronos seems to use the extended colour palette. I don't know if the Chronos is actually using more than 16 colours in this example.

    But, it might be worth raising it as a bug.

    In the meanwhile, I'll generate a watchface using my method above, and see how it looks.
  • Same behavior with the last 2.0.1 release :-(
  • 2200 grove

    Hello, i didn't find how to raise up a bug to Face It :-/
  • I tried a FaceIt watchface with my fenix 5 and it is ok on the watch, way way better than preview.
    In fact it's only the preview on iphone that is ugly