menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Breaking D...
source image

Dev

4w

read

277

img
dot

Image Credit: Dev

Breaking Down tilegen: A Deep Dive into Image Tiling

  • tilegen is a tool that slices high-res images into tiles across multiple zoom levels, similar to Google Maps.
  • It uses multi-threaded tile generation, high-performance image manipulation, and Bun as its runtime.
  • Inspired by Google Maps, tilegen cuts images into 256×256 PNG tiles for seamless zooming and panning.
  • Unlike Google Maps, tilegen does not use Mercator Projection, operating on raw pixel grids instead.
  • The tool's architecture involves metadata read, zoom level calculation, task generation, worker thread execution, and file output.
  • MAXIMUM_MAGNIFICATION controls how deep users can zoom in relative to the base image's pixel density.
  • tilegen adjusts tile quality for different zoom levels to optimize disk space without compromising quality.
  • Performance optimizations include spinning up worker threads and managing tasks efficiently.
  • Future plans for tilegen include CLI support, WebP and AVIF tile support, vector tile generation, JSON tile manifests, and potential Web Mercator pre-projection.
  • tilegen aims to be a fast, flexible tool for generating tiles for any large static image, offering simplicity and power.

Read Full Article

like

16 Likes

For uninterrupted reading, download the app