简体   繁体   English

遮罩颜色后在iOS上将图像与Alpha边缘融合

[英]Edge blending of image with alpha on iOS after masking color

I have an image that has been masked with a range of colors using 我有一个图像被使用多种颜色掩盖

CGImageCreateWithMaskingColors()

Everything works fine, but the edge of the image (we are using a green screen for profile pictures) is pixelated. 一切正常,但图像的边缘(我们为个人资料照片使用绿色屏幕)已像素化。 I've tried drawing the image in an image context and a bitmap context with the proper antialiasing, but the edges remain the same. 我尝试在图像上下文和位图上下文中使用适当的抗锯齿绘制图像,但是边缘保持不变。

Any suggestions on how to smooth the sides of the profile after it has been masked? 关于在遮盖轮廓后如何平滑轮廓侧面的任何建议?

You could try zooming the mask image larger by some multiple (say 2X, 3X or 4X) before creating the mask. 您可以尝试在创建遮罩之前将遮罩图像放大几倍(例如2倍,3倍或4倍)。 Then a size-reduced copy of this larger mask might be better antialiased. 然后,减小尺寸的此较大蒙版的副本可能会更好地抗锯齿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM