How can I convert png or jpg image files to svs or tif Aperio image formats? It can be in python, c++, c# or java. Is there any library that support tif or svs format?
Asked
Active
Viewed 1,620 times
1
-
I am unfamiliar with any seadragons, aperios or svses, but if you want to convert JPEG or PNG to TIFF, you can use **ImageMagick** at the commandline or go to Python and use **PIL**, or **Wand**, or **pyvips** or **OpenCV**. – Mark Setchell Sep 14 '20 at 07:39
-
Thank you Mr. Setchell. OpenSlide-python does not support converting JPEG or PNG to SVS or TIF, but can open tiff. So I will use TIFF fomat – Melody Sep 14 '20 at 08:20
-
If you want to try **ImageMagick** in your Terminal/commandline, it'd just be `magick INPUT.PNG OUTPUT.TIF` or maybe with some lossless compression if they are big `magick INPUT.PNG -compress LZW OUTPUT.TIF` – Mark Setchell Sep 14 '20 at 08:25
1 Answers
0
I think that this conversion is impossible since SVS constitutes a proprietary format. Openslide implements the logic to read SVS streams, but the same is not true for writing them as the specification is not open-source. A possible workaround can be found in this blog post which explains how to write an image with the minimum set of attributes that the Openslide reader method expects to sucessfully execute.

Francisco Cunha
- 355
- 1
- 4
- 14