[英]How can I get a transparent background in ImageJ/Fiji
I have a hexagonal image, stitched together from several single images, which is saved as a rectangle 8bit TIFF with black corners.我有一张六边形图像,由几张单张图像拼接而成,保存为带黑角的矩形 8 位 TIFF。 I want to set the black corners to transparent.我想将黑角设置为透明。 Because I want to stitch several hexagons together.因为我想把几个六边形拼接在一起。 I tried already the threshold function and set the black areas to NaN but after reopening the image the corners were still black.我已经尝试了阈值 function 并将黑色区域设置为 NaN 但在重新打开图像后,角落仍然是黑色的。 I also tried making a selection and clear outside which resulted in a white background.我还尝试进行选择并清除外部,从而产生白色背景。 I need to save it as a TIFF file again for further processing.我需要再次将其另存为 TIFF 文件以供进一步处理。 Does somebody has an idea how to solve that issue?有人知道如何解决这个问题吗?
8-bit images do not support transparency, only integer values from 0 to 255. 8 位图像不支持透明度,仅支持 0 到 255 之间的整数值。
If you want to use NaN, you must first convert to 32-bit float ( Image ▶︎ Type ▶︎ 32-bit ).如果要使用NaN,必须先转换成32位浮点数( Image▶︎Type▶︎32-bit )。 It is possible to save a 32-bit float image as TIFF—but note that many TIFF viewers (eg Preview on macOS) will not display it nicely.可以将 32 位浮点图像保存为 TIFF,但请注意,许多 TIFF 查看器(例如 macOS 上的预览)无法很好地显示它。
One way to set values to NaN is to use the Process ▶︎ Math ▶︎ Set... command, after making a selection.将值设置为 NaN 的一种方法是在进行选择后使用Process ▶︎ Math ▶︎ Set...命令。 Everything in the selection will become NaN.选择中的所有内容都将变为 NaN。
I think it is not possible because NaN or 0 as suggested By ctrueden gives a black background (does not delete it).我认为这是不可能的,因为 ctrueden 建议的 NaN 或 0 给出了黑色背景(不删除它)。 This require alpha channel to do so as it is the case in other software as GIMP (add alpha channel, select the background, delete. Hope this is useful !这需要 alpha 通道才能这样做,就像其他软件如 GIMP 中的情况一样(添加 alpha 通道,select 背景,删除。希望这有用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.