Skip to content

Improve the image support of the sdk - #23

Open
fdie wants to merge 1 commit into
ActiveLook:mainfrom
fdie:support_all_image_formats
Open

fdie wants to merge 1 commit into
ActiveLook:mainfrom
fdie:support_all_image_formats

Conversation

@fdie

@fdie fdie commented Sep 13, 2026

Copy link
Copy Markdown

Add the 3 missing image formats to the API, described in doc sections:

  • 5.5.4: 4bpp grey + 4-bits alpha channel bitmap
  • 5.5.5: red-green 8bpp color bitmap for color-glasses-only (e.g. Engo 3's MDP08 display module)
  • 5.5.6: red-green 8bpp color bitmap with 4-bits alpha channel per pixel

Also optimized the required image 180° rotations.

Measured on a Pixel 8 Pro (for a 304×224 image, 300 iterations each, 30 warmup iterations discarded):

old (rotateBMP_180+getPixels) new (getPixelsReflected) speedup
Run 1 668.2 µs 299.5 µs 2.23x
Run 2 645.2 µs 218.8 µs 2.95x
Run 3 639.7 µs 220.1 µs 2.91x

Consistently ~2.2–2.9x faster, cutting per-call time from ~650µs down to ~220–300µs.
Confirms the qualitative reasoning: removing the extra Bitmap allocation and Skia Canvas/Matrix
rasterization pass roughly triples throughput for this operation.

Sample

Source image
Italy-sRGB

RG color conversion
italy_rg8bpp

… 5.5.4, 5.5.5 & 5.5.6

Optimize the required image 180° rotation
@fdie

fdie commented Sep 13, 2026

Copy link
Copy Markdown
Author

I think it's best to let users handle the color conversion of their own images (I, for instance, generate my bathymetric layers directly as RG images, so no conversion is needed on my end).

That said, I did compare the performance and quality of 10 different RGB-to-RG color conversions — happy to contribute a ColorTransformation enum covering arbitrary RGB images if that's of interest.

Then again, it may not be worth the effort if only 2% of your customers use the SDK, and just 5% of those want to display images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant