ALL BUSINESS
COMIDA
DIRECTORIES
EDUCATIONAL
ENTERTAINMENT
FASHION TIPS
FINER THINGS
FREE CREATOR TOOLS
HEALTH
MARKETPLACE
MEMBER's ONLY
MONEY MATTER$
MOTIVATIONAL
NEWS & WEATHER
TECHNOLOGIA
TELEVISION NETWORKS
USA VOTES 2024
VIDEOS
INVESTOR RELATIONS
IN DEVELOPMENT
Posted by - Latinos MediaSyndication -
on - July 2, 2023 -
Filed in - Technology -
-
434 Views - 0 Comments - 0 Likes - 0 Reviews
I'm trying to apply this mask to the original image
Notice there are some grey areas, I want to keep everything except PURE black.
I've found this code
func maskImage(image: UIImage, mask: UIImage) -> UIImage { let imageReference = (image.cgImage)! let maskReference = (mask.cgImage)! let imageMask = CGImage( maskWidth: maskReference.width , height: maskReference.height , bitsPerComponent: maskReference.bitsPerComponent , bitsPerPixel: maskReference.bitsPerPixel , bytesPerRow: maskReference.bytesPerRow , provider: maskReference.dataProvider! , decode: nil , shouldInterpolate: true ) return (UIImage(cgImage: (imageReference.masking(imageMask!))!)) }
But it does the opposite, it removes all white pixels instead.