Description
Context
Issue type (bug report or feature request): bug report
Operating system (e.g. Fedora 24, Mac OS 10.11, Windows 10): Windows 10
Platform (e.g. 64-bit x86, 32-bit ARM): 64-bit x86
OpenSlide Python version (openslide.__version__
): 1.1.2
OpenSlide version (openslide.__library_version__
): 3.4.1
Slide format (e.g. SVS, NDPI, MRXS): TIFF
Details
I have some tiles converted using OpenSlide's deepzoom_tile.py
from TIFF, but I noticed that they have inconsistent width or height.
For example, I convert the CMU-1.tiff (from here) to DZI format using libvips, the tiles with level=10 will have the following size:
$ vips dzsave --tile-size 254 --overlap 1 CMU-1.tiff CMU-1
$ magick identify .\CMU-1_files\10\*.jpeg
.\CMU-1_files\10\0_0.jpeg JPEG 255x255 255x255+0+0 8-bit sRGB 3747B 0.000u 0:00.000
.\CMU-1_files\10\0_1.jpeg JPEG 255x256 255x256+0+0 8-bit sRGB 9657B 0.000u 0:00.000
.\CMU-1_files\10\0_2.jpeg JPEG 255x8 255x8+0+0 8-bit sRGB 756B 0.000u 0:00.000
.\CMU-1_files\10\1_0.jpeg JPEG 256x255 256x255+0+0 8-bit sRGB 6745B 0.000u 0:00.000
.\CMU-1_files\10\1_1.jpeg JPEG 256x256 256x256+0+0 8-bit sRGB 4395B 0.000u 0:00.000
.\CMU-1_files\10\1_2.jpeg JPEG 256x8 256x8+0+0 8-bit sRGB 754B 0.000u 0:00.000
.\CMU-1_files\10\2_0.jpeg JPEG 212x255 212x255+0+0 8-bit sRGB 8213B 0.000u 0:00.000
.\CMU-1_files\10\2_1.jpeg JPEG 212x256 212x256+0+0 8-bit sRGB 2354B 0.016u 0:00.000
.\CMU-1_files\10\2_2.jpeg JPEG 212x8 212x8+0+0 8-bit sRGB 738B 0.000u 0:00.000
In particular, the tiles in the last column have a width of 212px and the tiles in the last row have a height of 8px.
On the other hand, when converted using deepzoom_tile.py
, the tiles in the last row and the last column are generated with different widths and heights. In particular, the last column contains tiles of different widths.
$ python .\examples\deepzoom\deepzoom_tile.py --size 254 --overlap 1 .\CMU-1.tiff
Tiling slide: wrote 31644/31644 tiles
$ magick identify .\CMU-1_files\10\*.jpeg
.\CMU-1_files\10\0_0.jpeg JPEG 255x255 255x255+0+0 8-bit sRGB 6734B 0.000u 0:00.000
.\CMU-1_files\10\0_1.jpeg JPEG 255x256 255x256+0+0 8-bit sRGB 16262B 0.000u 0:00.000
.\CMU-1_files\10\0_2.jpeg JPEG 255x7 255x7+0+0 8-bit sRGB 809B 0.000u 0:00.000
.\CMU-1_files\10\1_0.jpeg JPEG 256x255 256x255+0+0 8-bit sRGB 11741B 0.000u 0:00.000
.\CMU-1_files\10\1_1.jpeg JPEG 256x256 256x256+0+0 8-bit sRGB 7340B 0.000u 0:00.000
.\CMU-1_files\10\1_2.jpeg JPEG 256x7 256x7+0+0 8-bit sRGB 765B 0.000u 0:00.000
.\CMU-1_files\10\2_0.jpeg JPEG 212x255 212x255+0+0 8-bit sRGB 13246B 0.000u 0:00.000
.\CMU-1_files\10\2_1.jpeg JPEG 211x256 211x256+0+0 8-bit sRGB 3904B 0.000u 0:00.000
.\CMU-1_files\10\2_2.jpeg JPEG 212x7 212x7+0+0 8-bit sRGB 784B 0.000u 0:00.000
The tiles in the last column have both 211px and 212px tile widths. (Also, the height of the tiles in the last row seems to be different from libvips.)
I'm confused by this behavior; what tile size should OpenSlide return in this case?