Skip to content
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

瓦片图有黑色块 #1

Open
1115284051 opened this issue Dec 2, 2022 · 9 comments
Open

瓦片图有黑色块 #1

1115284051 opened this issue Dec 2, 2022 · 9 comments

Comments

@1115284051
Copy link

获取的瓦片图,没有图像的地方应该是白色块,现在是 黑色的块。
1669967579295

@IOL0ol1
Copy link
Owner

IOL0ol1 commented Dec 2, 2022

1 是自定义的可视化软件吗?用哪一层接口获取的?或者是直接通过示例程序加载?
2 方便提供具体的病理文件吗?主页有联系方式,可以私发邮箱。

@IOL0ol1
Copy link
Owner

IOL0ol1 commented Dec 2, 2022

@1115284051
Copy link
Author

用的是示例的例子运行预览,.mrxs的玻片。我发一个 玻片文件到你邮箱

@1115284051
Copy link
Author

1115284051 commented Dec 2, 2022 via email

@IOL0ol1
Copy link
Owner

IOL0ol1 commented Dec 4, 2022

png转jpg时透明通道没处理好。
更新了,1.1.0版本,默认 bgra(0,0,0,0) => bgra(255,255,255,255)
透明的黑色将自动转换为白色。
https://github.com/IOL0ol1/OpenSlideSharp/blob/master/src/OpenSlideSharp.BruTile/Utilities.cs#L41

@1115284051
Copy link
Author

用了最新的 OpenSlideSharp.BruTile 1.1.1
还是黑色的图块

@1115284051
Copy link
Author

image
https://github.com/IOL0ol1/OpenSlideSharp/blob/master/src/OpenSlideSharp.BitmapExtensions/DeepZoomGeneratorExtensions.cs#L44
这一步,png透明色转成 jpg的时候变成了黑色,怎么设置白色呢

@IOL0ol1
Copy link
Owner

IOL0ol1 commented Feb 21, 2023

image https://github.com/IOL0ol1/OpenSlideSharp/blob/master/src/OpenSlideSharp.BitmapExtensions/DeepZoomGeneratorExtensions.cs#L44 这一步,png透明色转成 jpg的时候变成了黑色,怎么设置白色呢

ToStream方法需要重写一下,因为有的数字病理切片文件中的 透明像素是 R:0,G:0,B:0,A:0
这种像素在png下是透明的,但是转成jpg之后就变成黑色了。
目前我想到的解决方案是遍历像素,当像素的rgba都是0x00时,替换为 R:255,G:255,B:255,A:0

@Guendoozy
Copy link

await provider.DeepZoomGenerator.GetTileAsPngStream(result.level, result.col, result.row, out var tmp).CopyToAsync(response.Body);

This fixed it for me, added in my startup file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants