0

I'm trying to read a specific level (level=3) using pyvips:

image = pyvips.Image.new_from_file(data/imagestif/SUH_BR_0002.tif,level=3)

But I get this error: KeyError: 'level'

I don't why I can't specify the level with that argument, as the documentation says. I'm using 8.13 pyvips version.

Seakz
  • 11

1 Answers1

0

The level= parameter is for the openslide loader, so you can only use it for formats like SVS.

The TIFF loader doesn't know about pyramids, since TIFF images are organized in terms of pages and subifds. You probably want:

level = pyvips.Image.new_from_file("thing.tif", page=3)

But it depends on your file. Different applications will have encoded a pyramid into your tiff in different ways.

jcupitt
  • 10,213
  • 2
  • 23
  • 39