-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
converted image appears black vertical stripes #313
Comments
this is my code .i try to two way to finish:
code 2:
|
Your SVS file probably omits image tiles for empty portions of the slide. OpenSlide renders missing image tiles as transparent pixels, which you're seeing as black pixels because you're discarding the returned alpha channel. The stripes are surprising though. Could you upload a sample slide that shows this behavior? |
Thank you very much. I have uploaded my SVS file。 |
Operating system
Ubuntu 22.04.2 LTS (GNU/Linux 5.19.0-32-generic x86_64)
Platform
GNU/Linux 5.19.0-32-generic x86_64
OpenSlide Python version
1.4.1
OpenSlide version
4.0.0
Slide format
SVS
Issue details
I use openslide to convert my slice SVS file to PNG file, but the converted image appears black vertical stripes.

Here is my code:
`def tif_to_png_with_openslide2(tif_image_path, png_output_path):
try:
# 使用 OpenSlide 打开大文件
slide = openslide.OpenSlide(tif_image_path)
for key, value in slide.properties.items():
print(key, value)
slide_data = slide.read_region((0, 0), 1, slide.level_dimensions[1])
slide_data = np.array(slide_data)
r,g,b,a = cv2.split(slide_data)
slide_data = cv2.merge([r,g,b])
cv2.imwrite(png_output_path, slide_data)
this is slide.properties:
aperio.AppMag 40aperio.MPP 0.253910
openslide.associated.thumbnail.height 543
openslide.associated.thumbnail.width 1204
openslide.comment Aperio Image Format
154112x69600 [0,0 154112x69600] (256x256) JPEG/RGB Q=60|AppMag = 40|MPP = 0.253910
openslide.level-count 2
openslide.level[0].downsample 1
openslide.level[0].height 69600
openslide.level[0].tile-height 256
openslide.level[0].tile-width 256
openslide.level[0].width 154112
openslide.level[1].downsample 8
openslide.level[1].height 8700
openslide.level[1].tile-height 256
openslide.level[1].tile-width 256
openslide.level[1].width 19264
openslide.mpp-x 0.25391000000000002
openslide.mpp-y 0.25391000000000002
openslide.objective-power 40
openslide.vendor aperio
tiff.Artist KFBIO
tiff.ImageDescription Aperio Image Format
154112x69600 [0,0 154112x69600] (256x256) JPEG/RGB Q=60|AppMag = 40|MPP = 0.253910
tiff.ResolutionUnit inch`
The text was updated successfully, but these errors were encountered: