Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tito/image2mbtiles
Convert an image into mbtiles
https://github.com/tito/image2mbtiles
Last synced: 12 days ago
JSON representation
Convert an image into mbtiles
- Host: GitHub
- URL: https://github.com/tito/image2mbtiles
- Owner: tito
- Created: 2015-04-26T09:42:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T10:45:35.000Z (almost 2 years ago)
- Last Synced: 2024-10-27T07:34:05.137Z (24 days ago)
- Language: Python
- Size: 14.6 KB
- Stars: 12
- Watchers: 2
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert an image into a mbtiles
This script intend is to split an image into tiles in order to build a
deep-zoom image. The result will go into a mbtiles, ready to be embed on
mobiles for example.## Requirements
- Python 3
- Pillow >= 7.1.2## Installation
```
pip install -r requirements.txt
```## Usage
Syntax:
$ python image2mbtiles.py source.png output.mbtiles
For example, here is the output of a test:
$ python image2mbtiles.py 001_Baratta_Vue Naples_BnF.tif output.mbtiles
Analyse: /Users/tito/Downloads/001_Baratta_Vue Naples_BnF.tif
Size: 30192x10500
Mode: YCbCr
Maximum zoom: 7
Estimated tiles: 6334
-> Y offset: 22268
-> Generate zoom 7 (step is 32768)
- 1/6334 zoom:7 ix:0 iy:0 (0x0) step:32768
-> Y offset: 22268
-> Generate zoom 6 (step is 16384)
- 2/6334 zoom:6 ix:0 iy:0 (0x0) step:16384
- 3/6334 zoom:6 ix:0 iy:1 (0x16384) step:16384
- 4/6334 zoom:6 ix:1 iy:0 (16384x0) step:16384
- 5/6334 zoom:6 ix:1 iy:1 (16384x16384) step:16384
...Please note that the very first image loading can be slow until the whole image
is loaded. This is a Pillow behavior, and completly normal.