Repository navigation
Conversation
… 5.5.4, 5.5.5 & 5.5.6 Optimize the required image 180° rotation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the 3 missing image formats to the API, described in doc sections:
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):
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

RG color conversion
