Skip to content

Instantly share code, notes, and snippets.

View ahankinson's full-sized avatar

Andrew Hankinson ahankinson

View GitHub Profile
@dellsystem
dellsystem / gist:969077
Created May 12, 2011 17:58
VIPS tile processing

Look at the largest dimension (width or height)

  • 1 zoom level: 1 to 256
  • 2 zoom levels: 257 to 513
  • 3 zoom levels: 514 to 1027
  • 4 zoom levels: 1028 to 2055
  • 5 zoom levels: 2056 to 4111
  • 6 zoom levels: 4112 to 8223
  • ...
  • n zoom levels: (2^(n-2)) * (256 + 1) to (2^(n-1) * (256 + 1)) - 1 (except when n = 1, in which case the lower bound is just 1)