ByteTilesReaderWriter 1.0.0

.NET 5.0
dotnet add package ByteTilesReaderWriter --version 1.0.0
NuGet\Install-Package ByteTilesReaderWriter -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ByteTilesReaderWriter" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ByteTilesReaderWriter --version 1.0.0
#r "nuget: ByteTilesReaderWriter, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ByteTilesReaderWriter as a Cake Addin
#addin nuget:?package=ByteTilesReaderWriter&version=1.0.0

// Install ByteTilesReaderWriter as a Cake Tool
#tool nuget:?package=ByteTilesReaderWriter&version=1.0.0


File format for storing TileSets and designed to be accessed by byte range.

A MBTiles file contains a SQLite database and needs to be loaded in memory before requesting data. Instead a ByteTiles file constains a list of tiles and a dictionary (tile key - byte range) that indicates the position in the file for any tile. The dictionary is thinked to be loaded in a fast memory access (cache or database) for a fast tile reading.


  • Cost: A ByteTiles file can be uploaded in Amazon S3 and then fetch tiles by it range of bytes.
  • Storage size: A ByteTiles files is 5-10% smaller than MBTiles file.
  • Updates: Instead of extracting the files contained in MBTiles and upload them all to S3, ByteTiles contains all in a single file.

Built With

  • C#
  • JavasScript


ByteTiles specification is provided in the ByteTilesSpec folder.


Some examples are contained in the SimpleByteTilesServer and ByteTilesReaderWriter_Test projects.


  1. Clone the repo
    git clone
  2. Install NPM packages
    npm install

Additionally the nuget package with the ByteTilesReaderWriter library can be installed.


The package contains the following directories:

  • ByteTilesReaderWriter: Library to parse a .mbtiles file to .bytetiles file, read tiles and extract files to folder.
  • ByteTilesReaderWriter_Test: Test for the ByteTilesReaderWriter library.
  • SimpleByteTilesServer: Simple ByteTiles server with examples.
  • ByteTilesLogo: ByteTiles logo files.
  • ByteTilesSpec: ByteTiles specifications.

Library usage

The library ByteTilesReaderWriter can be used as following.

  • Parse .mbtiles to .bytetiles:
ByteTilesWriter.ParseMBTiles("input_file.mbtiles", "output_file.bytetiles");
  • Read tiles:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
byte[] tile = byteTilesReader.GetTile(x, y, z);
  • Read tiles dictionary:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
var tilesDictionary = byteTilesReader.GetTilesDictionary();
  • Read json metadata:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
var metadata = byteTilesReader.GetMetadata();
  • Extract .bytetiles files to directory.
var byteTilesExtractor = new ByteTilesExtractor("input_file.bytetiles");

Server usage

Set the SimpleByteTilesServer as startup project and run. The server will read tiles from the files of the ByteTilesReaderWriter_Test project.


See the open issues for a list of proposed features (and known issues).


Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request


See license for more information.


Jesús Barrio - @techjb

Project Link:

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 259 5/12/2021