Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?

I want to have a picture as a background, say this:


Then I would like to apply a mask, just a circle with blurred edges, so it looks like this:


The idea is to simulate something emitting. Is this a good way of simulating light or should I use another method? And if so how? And I'm not really sure how to apply this method.

share|improve this question

marked as duplicate by Nicol Bolas, Josh Petrie, bummzack, Byte56, Noctrine Aug 15 '12 at 20:32

This question was marked as an exact duplicate of an existing question.

I think your question is a duplicate of the one I linked. For posterity, I have also edited your question to contain the same content as the SO question you linked to, since I have also flagged the SO question to be closed/deleted as a duplicate of this one (it is more appropriate here). – Josh Petrie Aug 11 '12 at 18:13
well you removed the iPad out of the title so no i got an answer for mac osx not for iOS so yeah thanks.. – user1586195 Aug 11 '12 at 20:45
@user1586195 You can always edit your post and add "iPad" back in if that's so important to you. Also: The Core Image Framework is available on iOS, so the answer you got applies to iOS as well. – bummzack Aug 12 '12 at 8:51

You could use the Core Image CISpotLight filter:

CIImage *inputImage = // your image here
CIFilter *spotlight = [CIFilter filterWithName:@"CISpotLight"];
[spotlight setDefaults];
[spotlight setValue:inputImage forKey:@"inputImage"];
CIImage *spotlightImage = [spotlight valueForKey:@"outputImage"];

See the Core Image Programming Guide for more information.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.