Convert .mds to .tiff

Trying to convert .mds file into any other image file format.
I found that pathomation provide python API as the link below.

However, when I try converting, there is an error and I can only get all-black image.

Error code

Fetching image info for C:/Users/sample/1.mds
38870 46395
Traceback (most recent call last):
File “”, line 119, in
File “”, line 90, in main
img =
File “C:\Users\AppData\Roaming\Python\Python38\site-packages\PIL\”, line 2943, in open
raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x0000022171874F90>

I searched for image to bytes information, and checked some solutions in stackoverflow
However, nothing could solve the error.

I also thought the problem might be .mds file format, so I tried other files such as .mrxs and even .png file, but all of them showed same error.

How can I fix this?
Or, are there any other tools that can convert .mds file to image file(hopefully .png format)?