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

Convert archive image formats #212

Open
neodescis opened this issue Mar 4, 2025 · 3 comments
Open

Convert archive image formats #212

neodescis opened this issue Mar 4, 2025 · 3 comments

Comments

@neodescis
Copy link

neodescis commented Mar 4, 2025

I have a rather large pmtiles archive that has PNG tiles inside (digital terrain tiles). I'd like to convert it to WebP format. It'd be great if pmtiles convert could do this for me. Alternatively, if there is any other (relatively) expedient way to make such a conversion, I'm all ears!

@bdon
Copy link
Member

bdon commented Mar 4, 2025

This won't be part of the default functionality because there is no optimized WebP writer, as far as I know, that uses Go only. Depending on a native library would make it impossible to easily cross-compile the single binary for this program.

We could instead expose an iterator convenience function over an archive that writes a new archive, performing an operation on each unique tile, and then you could write a short program that reads in PNG and writes WebP.

@neodescis
Copy link
Author

That sounds like a good idea to me, as it would open the door to many other processing abilities as well. It would need to allow for modification of the metadata as well somehow to support a format change.

@neodescis
Copy link
Author

For my particular use case, I think I've got a workaround. It's slow-going (I'm still on step 3), but it appears that this will work:

  1. Use the python pmtiles-convert to convert back to .mbtiles
  2. Use mb-util to export tiles to a directory as WebP
  3. Use pmtiles-convert to take the WebP tiles into another .pmtiles archive

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

No branches or pull requests

2 participants