Skip to content

Instantly share code, notes, and snippets.

@rvalieris
Last active October 26, 2022 17:07
Show Gist options
  • Save rvalieris/c7db3c00a4704e998213dfa105726f87 to your computer and use it in GitHub Desktop.
Save rvalieris/c7db3c00a4704e998213dfa105726f87 to your computer and use it in GitHub Desktop.
import pyvips
a = pyvips.Image.new_from_file('input.svs')
image_desc = a.get('tiff.ImageDescription')
a.set_type(pyvips.GValue.gstr_type, 'image-description', image_desc)
a.tiffsave('output.tif', pyramid=True, tile=True, compression='jpeg', tile_height=256, tile_width=256, Q=80)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment