TIFFTILE(3tiff)

okay so this is TIFFTILE(3tiff) from the LibTIFF crew, and if you've ever been like "wait, how big is a tile actually" β€” bestie, this page is literally for you. no cap. πŸŽ€


✨ SYNOPSIS ✨

#include <tiffio.h>

void TIFFDefaultTileSize(TIFF *tif, uint32_t *tw, uint32_t *th)

tmsize_t TIFFTileSize(TIFF *tif)

uint64_t TIFFTileSize64(TIFF *tif)

tmsize_t TIFFTileRowSize(TIFF *tif)

uint64_t TIFFTileRowSize64(TIFF *tif)

tmsize_t TIFFVTileSize(TIFF *tif, uint32_t nrows)

uint64_t TIFFVTileSize64(TIFF *tif, uint32_t nrows)

uint32_t TIFFComputeTile(TIFF *tif, uint32_t x, uint32_t y, uint32_t z,
uint16_t sample)

int TIFFCheckTile(TIFF *tif, uint32_t x, uint32_t y, uint32_t z,
uint16_t sample)

uint32_t TIFFNumberOfTiles(TIFF *tif)

🌸 DESCRIPTION 🌸

πŸŽ€ the tile-sizing girlies

TIFFDefaultTileSize() hands you back the pixel width and height of a tile that's, like, a reasonable size β€” perfect for setting up the TileWidth and TileLength tags. and here's the tea: if the tw and th values you pass in are non-zero, they get adjusted to reflect whatever compression-specific requirements are in play. the width and height it gives back are constrained to be a multiple of 16 pixels, because the TIFF specification said so and we respect her. πŸ’…

TIFFTileSize() returns the equivalent size for a tile of data β€” exactly as it would come back in a call to TIFFReadTile(), or as it would be expected in a call to TIFFWriteTile(). and if you want the big-girl number, TIFFTileSize64() returns a uint64_t. if an error happens? 0 comes back. 🫠

TIFFVTileSize() gives you the number of bytes in a row-aligned tile with nrows of data. TIFFVTileSize64() is the same vibe but returns a uint64_t. error? 0. always 0.

TIFFTileRowSize() = the number of bytes of a row of data in a tile. TIFFTileRowSize64() = that same energy, as a uint64_t. and yeah, if an error occurs, 0 is returned.

πŸ”₯ the coordinate girlies

TIFFComputeTile() returns the tile that contains the coordinates you specified. and lowkey the best part: a valid tile is always returned β€” out-of-range coordinate values get clamped to the bounds of the image, so she's forgiving like that. πŸ₯°

  • the x and y parameters are always used in calculating a tile
  • the z parameter is used if the image is deeper than 1 slice (ImageDepth > 1)
  • the sample parameter is used only if data are organized in separate planes (PlanarConfiguration = 2)

TIFFCheckTile() returns a non-zero value if the supplied coordinates are within the bounds of the image, and zero otherwise. she's the vibe check of this whole page, fr fr. here's what she checks:

  • the x parameter is checked against the value of the ImageWidth tag
  • the y parameter is checked against the value of the ImageLength tag
  • the z parameter is checked against the value of the ImageDepth tag (if defined)
  • the sample parameter is checked against the value of the SamplesPerPixel parameter if the data are organized in separate planes

TIFFNumberOfTiles() returns the number of tiles in the image. that's it, that's the whole function, she's an icon of efficiency. πŸ‘‘


πŸ’€ DIAGNOSTICS πŸ’€

None.

like... none. not a single one. she said "no notes." 😭

πŸ¦‹ SEE ALSO πŸ¦‹

  • TIFFReadEncodedTile (3tiff)
  • TIFFReadRawTile (3tiff)
  • TIFFReadTile (3tiff)
  • TIFFWriteEncodedTile (3tiff)
  • TIFFWriteRawTile (3tiff)
  • TIFFWriteTile (3tiff)
  • libtiff (3tiff)

πŸ‘‘ AUTHOR πŸ‘‘

LibTIFF contributors β€” the collective main character energy behind all of this. 🫢


1988-2025, LibTIFF contributors


and that's the whole page, bestie!! ✨ this was LibTIFF 4.7, dated Jun 27, 2026 β€” go forth and tile responsibly, you absolute legend. πŸ’–πŸŽ€πŸ¦‹