Search code examples
image-processingjpegcodecimage-compressionjpeg2000

JPEG2000 : Can number of tiles in X direction be zero?


According to JPEG2000 specs, Number of tiles in X and Y directions is calculated by following formula:

numXtiles =  (Xsiz − XTOsiz)/ XTsiz & numYtiles =  (Ysiz − YTOsiz)/ YTsiz

But it is not mentioned about the range of numXtiles or numYtiles. Can we have numXtiles=0 while numYtiles=250 (or any other value) ?


Solution

  • In short, no. You will always need at least one row and one column of tiles to place your image in the canvas.

    In particular, the SIZ marker of the JPEG 2000 stream syntax does not directly define the number of tiles, but rather the size of each tile. Since the tile width and height are defined to be larger than 0 (see page 453 of "JPEG 2000 Image compression fundamentals, standards and practice", by David Taubman and Michael Marcellin), you will always have at least one tile.

    That said, depending on the particular implementation that you are using, there may be a parameter numXtiles that you can set to 0 without crashing your program. In that case, the parameter is most likely being ignored or interpreted differently.