Re: Masking UIImages (yes, again)
Re: Masking UIImages (yes, again)
- Subject: Re: Masking UIImages (yes, again)
- From: Luke Hiesterman <email@hidden>
- Date: Sun, 26 Jun 2011 23:03:56 +0000
- Thread-topic: Masking UIImages (yes, again)
On Jun 26, 2011, at 3:06 PM, "James Miller" <email@hidden> wrote:
> I've been reading and experimenting and browsing and reading and experimenting but mostly failing miserably here and I need to ask the hive mind for some assistance.
>
> In a nutshell, I'm just trying to take a range of white colors out of a UIImage and make those colors transparent. From what I've read, I shouldn't use PNGs with an alpha already defined, but I also shouldn't use JPGs because they don't have an alpha channel.
Where did you read that you shouldn't use PNGs with alpha?
>
> So I've been trying to the extract the UIImage's CGImage and then convert it from RGB to RGBA and THEN mask it with CGImageCreateWithMaskingColors with no success (transparent areas appear as black). I've tried various techniques involving CGBitmapContextCreate and CGImageCreate but with no luck.
Note that if you did successfully make parts of your image transparent, they would show up as black if drawn into an opaque context. How are you drawing/displaying the image?
Luke
>
> This can't POSSIBLY be as complicated as I'm making this out to be! Can someone please show me how to do this properly!?
>
> A thousand thank yous and a pet herring named after you!
>
> --James
>
>
>
>
> "The world is divided into people who do things and people who get the credit. Try, if you can, to belong to the first class. There's far less competition."
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden