I have a watchface with a relatively large number of bitmaps and I'm trying to keep the file size as small as possible. The bitmaps were created and saved as .PNG files with transparency (and transparency needs to be preserved).
API 4.0.0 introduced "packingFormat" in the resource definition file. For example, I can do:
<drawables>
<bitmap id="foo" filename="foo.png" scaleX="40%" scaleY="40%"
packingFormat="png" compress="true"/>
</drawables>
The options for packingFormat are: default, png, jpg, yuv
https://developer.garmin.com/connect-iq/core-topics/resources/
Now, my question: jpg files seemingly shouldn't allow transparency. But yet when I specify packingFormat="jpg", the watchface still works, and transparency renders correctly! Furthermore, the .PRG file size is significantly smaller than if I set packingFormat to any of the other formats. How is that possible? What is going on when I set packingFormat = "jpg" for a source image that contains transparency?
Below is a comparison of the size of the binary .PRG file for each of the packing formats:
| png | 450 KB |
| yuv | 176 KB |
| default | 168 KB |
| jpg | 150 KB |