简体   繁体   English

iOS:如何在白色背景上应用自定义图像滤镜

[英]iOS: How to apply custom image filter with white background

I want to do something like this: 我想做这样的事情:

在此处输入图片说明

Take an image with white background, and apply black colour only in the rest of the image. 拍摄具有白色背景的图像,然后仅在图像的其余部分应用黑色。

How can I do this with iOS? 如何使用iOS做到这一点?

I have done something similar to create bar button images. 我做了类似的事情来创建条形按钮图像。 Toy create a context, paint it white, turn your images into "masks" using Quartz functions, then draw them into the context. Toy创建一个上下文,将其绘制为白色,使用Quartz函数将图像转换为“蒙版”,然后将其绘制到上下文中。 If this works for you leave a comment below I'll track down my link. 如果这对您有用,请在下面留下评论,我将跟踪我的链接。

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

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