"Instant alpha" function in iPhone app - iphone

Is there anything in the SDK which would allow you to replicate the instant alpha functionality found in some mac apps (Pages, Keynote, Preview) on the iPhone?
Basically my objective is to take a picture which contains a main object against a fairly even background, and eliminate the background leaving only the main object. The user could select the areas that represent the background. As an example, from this original: http://i.stack.imgur.com/vOgvn.jpg
We would get this image after applying the effect (white background is transparent): http://i.stack.imgur.com/McGwA.png

In the SDK, no. You'd have to loop through every pixel and check it's color and see if it is within some threshold you have specified.

Related

How do I access stored backgrounds on iOS, and change the device background?

I'm working on an iOS app to search for backgrounds, save them to the device, and change the default background. I need to know how to access backgrounds already stored on the device, how to save new backgrounds to that location, and how to set the device's default background from my app.
2 problems:
There is no distinction between 'background' and 'image'. You can use any image in your photos library as the background image. So "I need to know how to access backgrounds already stored on the device" amounts to looking in the photo library.
There's no way to access the 'set-as-background' method from a 3rd-party app.

Which Launch Image Should I Use?

I'm building a game for the iphone, and the main window displays an image in the background describing the game, and I have few other layers of images which are the buttons such as Start New Game, Options and Help.
Should the launch image be only the background image describing the game without the extra image layers or should it be image including the other layers which are Start New Game, Option and Help?
Thanks.
The bit covering launch images can be found here. Below is an example launch image (left) provided by Apple.
Their docs specifically site concerns about localization, so it's probably best to do without the text and provide an image that just has your background chrome for the view.
The launch image should give the illusion of a really fast launching of your app. So the better image in your case is an hybrid of your proposal.
You should have the background image describing the game with the extra image layers without the text inside your buttons (Start new game, etc.) If you include the text, the user could think that your app is loaded and would tap on it.
Hope this helps
All the Apple guidelines on launch images are available here (scroll down to "Launch Images" section). It seems like the convention is to show buttons but not table view data, based on the examples show and from observing other Apple apps.
It's probably up to you to determine which looks better. I have seen many apps on the app store that totally ignore all of these things you aren't supposed to do:
An “application entry experience,” such as a splash screen
An About window
Branding elements, unless they are a static part of your application’s first screen
So I don't think it's that important for App Store acceptance, but it is very important for user experience.

Wrong iPhone launch image displayed when iPhone app is launched on iPad

I have developed a straight iPhone/iPod Touch app.
A launch image is implemented for Retina displays as well as the lower resolution of the former generation devices.
Those images are displayed properly on the iPhone simulator as well as on several iPhone an iPod Touch devices.
However, since some days, when launched on an iPad (1) or iPad simulator one of the other images within the app is shown.
Apparently the image that is displayed wrongly, is one of two amongst ca. 70 images within the app. Those two images happen to be either
1. the first image in my xcode project groups hierarchy.
-or-
2. the first image in my project in alphabetical order.
I did not yet find a pattern of when 1. or 2. happens, so when the first image in the project's hierarchy of groups is taken or when the first in alphabetical order is taken. But it seems to be one of these two files only.
Any idea what I probably did wrong so that a wrong image is picked as launch image of this iPhone-only app whenever it is launched on an iPad?
Thanks in advance.
Cheers
Hermann
Try inserting an image named Default.png into Xcode. That's all, just drag it in. Xcode recognizes any picture named Default.png as the loading image. That should make it work.
To expand a little on Jack's answer - you can indeed use an image named Default.png which will automatically be used as a launch image for your app.
However,you can also customise the launch image for particular hardware and device orientations by using images of a particular size and name - for example, a 768x1004 pixel image named Default-Portrait~ipad.png added to your project will be automatically used as the launch image when you launch the app on an iPad in portrait orientation.
The use of these customised images is highly recommended, as it allows the launch image to be sized appropriately for the different shapes of screen (i.e. iPhone and iPad), and allows high resolution launch images to be used on Retina display devices.
For a list of these sizes and image names, see this page. The items of interest are the ones beginning with "Default"
All iPhone apps have a splash screen, or what Apple refers to as a “launch image”. It is the screen that is displayed immediately after you press your app’s icon on the home screen, while the app icons are sweeping away and your app is zooming into view.
Some apps opt not to display a splash screen and go for a black screen, which is the default behaviour when you create an app. Others display a wireframe of the app’s interface in order to look like it is loading faster. See Apple’s native apps such as Clock and Camera for good examples of this. The most common use of the splash screen (especially in games) is to present a company or game logo, as we do in Addicus:
Apple has made it so easy to set your splash screen that you don’t even need a single line of code to do it. Why, you don’t even need to change a setting. Here’s how to set your splash screen it in just 2 steps:
Add a file to your project’s Resource folder called Default.png.
There is no step 2. Take this time to reflect on how good life is.
And that’s it. Run your app and your splash screen will zoom into glorious view.
A couple of things to watch out for when working with splash screens:
Whatever image you give it will be scaled to fill the 320×480 resolution of the iPhone, so ideally you would use a 320×480-sized image.
If your iPhone app is running in landscape mode, you need to rotate the splash screen you use. For example, our splash screen is rotated 90 degrees to the right in the above image.
See more at: http://getsetgames.com/tag/launch-image/#sthash.GEXwuzsf.dpuf

How will I have to update how I program for iPhones now with iOS4?

For example, preparing a launch screen of 320 x 480 would have to be changed....
How is that going to work for us? Are programmers always going to have to be submitting a high-res that will be scaled down for old devices such as the iphone 3g?
The size of the screen is basically 4 times on a pixel by pixel basis. So each pixel of your image for example gets boosted to 4.
What this means for you? You don't have to change your App, your app will scale to the hi res screen for you, same with your UI and images within your UI. Of course if you want to take advantage of the better screen quality you will have to submit hi res images.
I haven't looked at going the other way but I believe it would be a similar case.
One exception to this is text. It automatically scales to the higher res for you for free. So text will look super sharp. One problem with this is if your loading image has text based on the original load screen that wouldn't look the same as when the high res text loads.
Strictly speaking, anyone who's seen the documentation on how they're handling this is still under non-disclosure until Monday, when the new iOS ships.
Suffice to say, it's clever. You'll be able to put both high and low-rez versions of ALL your images into your app, and then load them into your app in a way that's totally transparent from the code side. The device will make its own call about which version of the image is appropriate for the kind of screen it's got.
Now that the WWDC 2010 videos are available for free to any registered iPhone developer (or ADC member), I recommend watching Session 134: Optimize your iPhone App for the Retina Display for a full description of what you need to do to support the iPhone 4's new display.

Application Icon(57*57) and Large icon(512*512) it should be same picture?

so wonder is it need to be the same picture?
it can use difference picture ?
(Edited)
In link text stated:
When you submit your application, you
must include a 512 x 512 pixel version
of your application icon for display
in the App Store. Although it’s
important that this version be
instantly recognizable as your
application icon, it should be subtly
richer and more detailed. In other
words, you should not simply scale up
your application icon to create an
icon for the App Store.
So I think from this follows that you can make cosmetic changes to your picture to make it look better in good resolution.
In our app we do the reverse thing - we create 512x512 artwork and use its scaled to 57x57 variant as application icon.