Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libwebp for Decoding WebP raster tiles #58

Closed
roblabs opened this issue Mar 29, 2021 · 3 comments
Closed

Add libwebp for Decoding WebP raster tiles #58

roblabs opened this issue Mar 29, 2021 · 3 comments
Labels
enhancement New feature or request iOS

Comments

@roblabs
Copy link
Collaborator

roblabs commented Mar 29, 2021

WebP is an open source image format that provides smaller file sizes and lossy & lossless formats.

  • See the branch roblabs/maplibre-gl-native:webp-ios for details on how to bring WebP into MapLibre. The decision was made to document how to do this, rather than a formal PR at this time.

  • a basic style for adding a WebP raster layer for Joshua Tree National Park.

{
  "version": 8,
  "name": "Joshua Tree National Park...in WebP",
  "center": [-115.746, 33.866],
  "zoom": 7,
  "sources": {
    "jotr": {
        "tiles": [ "asset://joshuatree/{z}/{x}/{y}.webp" ],
        "type": "raster"
    }
  },
  "layers": [
    {
      "id": "background",
      "type": "background",
      "paint": {
        "background-color": "#ddeeff"
      }
    },
    {
        "id": "jotr",
        "type": "raster",
        "source": "jotr",
        "layout": {},
        "paint": {}
    }
  ]
}

This work is donated by ePi Rational, Inc. based on work initially done by mapbox/mapbox-gl-native

And updated over several versions of the iOS SDK.


Example of WebP rasters in MapLibre for Joshua Tree National Park

@roblabs
Copy link
Collaborator Author

roblabs commented Mar 31, 2021

Test Results of Archive & upload to App Store Connect (TestFlight) of the MapLibre test app iosapp with MapLibre + WebP

Results Summary — the WebP SDK adds approximately 0.4 MB to the install size for iOS & iPadOS variants.

Key

  • 🗺 - Size of iosapp with MapLibre SDK only
  • 🗺+🕸 - Size with MapLibre SDK + WebP SDK
  • The Universal Device Type has data for a basic MapKit app based on Swift UI. This is intended to demonstrate the smallest possible app that can render a MapKit based map.

Methodology

  • Upload a build to App Store Connect with app thinning.

  • App Store Connect reports App Store File Sizes in KB.

  • app thinning "creates variants of your app for different devices and operating system versions. You can view the size of the variants directly in App Store Connect."1

  • Approved apps for the App Store are "encrypted with DRM and recompressed. The added encryption and DRM affects the ability to compress your binary, and as a result you may see a larger App Store file size for your binary than the binary you uploaded in App Store Connect."1

  • 1 - Definitions such as Download and Install size - https://help.apple.com/app-store-connect/#/dev3b56ce97c?sub=dev7379ba2ed

DEVICE TYPE DOWNLOAD SIZE INSTALL SIZE
This is the compressed size of the app downloaded over the air.1 This is the amount of disk space the app will take up on the customer's device. The install size also appears on your app’s product page in the Information section.1
Universal 1706 KB MapKit
11742 KB 🗺
12443 KB 🗺+🕸
---
🕸 adds an additional 701 KB
1924 KB MapKit
20146 KB 🗺
20904 KB 🗺+🕸
---
🕸 adds an additional 758 KB
iPad (6th generation)  6221 KB  🗺
6598 KB 🗺+🕸
---
🕸 adds an additional 377 KB
 14105 KB  🗺
14502 KB 🗺+🕸
---
🕸 adds an additional 397 KB
iPad Pro (11‑inch)  6220 KB  🗺
6597 KB 🗺+🕸
---
🕸 adds an additional 377 KB
 14100 KB  🗺
14498 KB 🗺+🕸
---
🕸 adds an additional 398 KB
iPad Pro (12.9‑inch) (4th generation)  2834 KB  🗺
3034 KB 🗺+🕸
---
🕸 adds an additional 200 KB
 14007 KB  🗺
14396 KB 🗺+🕸
---
🕸 adds an additional 389 KB
iPhone 5S  6216 KB  🗺
6594 KB 🗺+🕸
---
🕸 adds an additional 378 KB
 14096 KB  🗺
14494 KB 🗺+🕸
---
🕸 adds an additional 398 KB
iPhone 7 Plus  6225 KB  🗺
6603 KB 🗺+🕸
---
🕸 adds an additional 378 KB
 14105 KB  🗺
14502 KB 🗺+🕸
---
🕸 adds an additional 397 KB
iPhone 11 Pro Max  2839 KB  🗺
3038 KB 🗺+🕸
---
🕸 adds an additional 199 KB
 14011 KB  🗺
14401 KB 🗺+🕸
---
🕸 adds an additional 390 KB
iPhone SE (2nd generation)  2830 KB  🗺
3029 KB 🗺+🕸
---
🕸 adds an additional 199 KB
 14003 KB  🗺
14392 KB 🗺+🕸
---
🕸 adds an additional 389 KB
iPhone 12 mini  2839 KB  🗺
3038 KB 🗺+🕸
---
🕸 adds an additional 199 KB
 14011 KB  🗺
14401 KB 🗺+🕸
---
🕸 adds an additional 390 KB
iPhone 12 Pro Max  2839 KB  🗺
3038 KB 🗺+🕸
---
🕸 adds an additional 199 KB
 14011 KB  🗺
14401 KB 🗺+🕸
---
🕸 adds an additional 390 KB
iPod touch (6th generation)  6216 KB  🗺
6594 KB 🗺+🕸
---
🕸 adds an additional 378 KB
 14096 KB  🗺
14494 KB 🗺+🕸
---
🕸 adds an additional 398 KB

@louwers louwers added enhancement New feature or request iOS labels Jan 25, 2023
@louwers
Copy link
Collaborator

louwers commented Sep 22, 2023

According to this comment from @mwilsnd this is supported on iOS by now. Let me know if it's not.

@roblabs
Copy link
Collaborator Author

roblabs commented Jun 7, 2024

Closed from #1314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request iOS
Projects
None yet
Development

No branches or pull requests

2 participants