Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个透明背景上的白色图像,但白色在对象的边缘周围有一些 alpha 通道(由于抗锯齿)。我怎样才能使这个纯白色透明,通过舍入 alpha 通道使 > 0.5 变为白色并且 <= 0.5 变为透明?
您需要将 Alpha(透明度)通道的阈值设置为 50%,从而将所有低于 50% 的透明度强制为零,并将超过 50% 的透明度强制为 100%。像这样:
convert image.png -channel alpha -threshold 50% out.png