XCode: Tab Bar Item image is pixelated - xcode

I am using custom images for tab bar icons and they are showing up pixelated and I can't figure out why. The image is 32x32 and 300ppi. I've tried it on 72 and 150ppi and they are all pixelated. Anyone have a solution?
Thanks,
Adam

You need two images one 32 x 32 pixels and named MyIcon.png and one 64 x 64 pixels named MyIcon#2x.png. You then specify MyIcon in the storyboard and iOS will load the correct image for the current hardware.
The ppi (is a print production concept) has no effect in iOS. iOS measures every thing in Points, the iPhone 5 screen is 320 points x 568 points. Retina screens are 2 pixels x 2 pixels for each point. Non retina screens are 1 pixel = 1 point.
UPDATE:
For the iPhone 6 Plus (iOS 8) you now need a third image MyIcon#3x.png that is 96 x 96 see Image resolution for new iPhone 6 and 6+, #3x support added? for lots of good details.

Related

Should iPad 3 Retina images be 4x resolution?

I've been slicing images from a PSD for an app and the design team is saying that the slices look fuzzy on ipad.
The design I'm slicing from is 2048 by 1536. The team says I need to double the size of the resources when saving. This would size them relative to a 4096 x 3072 pixel PSD.
That's #4x screen resolution.
Does' iPad3 really support #4x resolution? I thought retina was only 2x...

iPhone 5 - Background images

With the new screen resolution and aspect ratio of iPhone 5 it seems there are two approaches to take advantage of the new screen real estate when handling images that are full screen (or mostly full screen) images:
Include two images bg#2x.png and bg-h568#2x.png and check the device's main screen bounds to figure out which to load.
Only include the one file but make it the full iPhone 5 resolution
(There are other methods also: stretching, tiling, and / or drawing with Quartz.)
Both of these options have drawbacks:
Including two files is going to increase your app's bundle size
Loading a iPhone 5 retina image on a 4 will clip the image data when displayed on screen, but will still consume the same amount of memory resources
I am particularly interested in understanding the details of the second drawback better.
I am thinking it would save the app bundle (and my designer) if I could use this consolidating images idea further...
Let's say I have an image that take up 320pt x 480pt in portrait and 480pt x 320pt in landscape (width x height).
(EDIT: Initially I hadn't considered a couple of other important tidbits. For sake of completeness, I'm including those thoughts here)
If we create a single image file at a 480pt x 480pt resolution instead of landscape and portrait files, it would prevent the app bundle from having two files that which each contain 320pt x 320pt area of duplicate image data. However, this large square image would include four 80pt x 80pt quadrants in the corners that won't be seen. All things equal, we should still have 20% less image data in the app bundle.
Having re-read Bill's "iBooks Author Experiment", the memory requirements are very easy to figure out:
Landscape or Portrait: 640 * 960 * 4 = 2,457,600
Large Square: 960 * 960 * 4 = 3,686,400
The memory required to load the large square is 50% more then loading the image sized correctly for the screen. Clearly the savings in the app bundle don't measure up to this hit on resources!
But, what about extending this to a giant square that would encompass iPhone 5 and iPhone 4 - 568pt x 568pt? Instead of four files (iP4 landscape, iP4 portrait, iP5 landscape, iP5 portrait), there would be only one file in the app bundle (giant square). The savings could be about 60%.
What about the resources hit?
iPhone 5 Landscape or Portrait: 1136 * 640 * 4 = 2,908,160
Giant Square: 1136 * 1136 * 4 = 5,161,984
That's 110% more memory for iPhone 4, and 77.5% more memory for iPhone 5.
My original question was roughly two parts: 1. Do I understand this correctly and 2. is this tradeoff a wise one to make.
I hope my edits (spurred by Bill's answer) show that I do understand this stuff now. And, if the new found knowledge is correct, then #2 pretty much answers itself. :-)
Generally you get it.
Assuming that you have the big square image and it's some kind of tiled pattern (linen etc) then you could use ImageIO to load the cropped image at the size you need which would use some extra memory decompressing the image but once done it would consume only what is needed to fill the background.
I would suggest against scaling the image.
On the flip side though, shipping an app with 3 images (foo, foo#2x and foo-h568#2x) instead of 1 makes way more sense. The only way I'd say you should go with one image is if you are close to the 3G/LTE download size of (I think) 50MB.

VB6 app icon in Windows 7 taskbar is blurred

I have a VB6 application and one of the Form icon is set as application icon. The problem is that in Windows 7 the icon looks blurred even though the icon contains 16x16, 32x32 and 48x48 sizes.
Is there a way around this problem? It tried the SendMessage(... SETICON... ICON_BIG) but it does not seems to work.
What colour depth are the icons in your ico file?
VB6 (I believe) supports a maximum 8 bit colour depth (256 colours) for icons:-
So if there is no size 48 x 48 icon in 8 bit colour depth it could be using the nearest match and scaling it to 48 x 48
EDIT:
I just tried this using an icon that did not have a 48 x 48 icon at 8 bit depth (but did have 48 x 48 at higher depths) and the icon used in the taskbar was the 32bit icon at 8 bit colour depth.
I don't claim to understand the full heuristics used to choose the icon image to display in various places, but I think what is happening here is that your 48x48 image is being taken and scaled down.
I suspect what happens with a VB6 program on many versions of Windows is that if there is no 16-color 16x16 image then a larger size gets taken and scaled. The reason may simply be due to the order of the images in the ICO resource/file.
If you edit your ICO and add a 16-color version of your 16x16 image your "problem" may disappear.

What does e a large triangle with a yellow exclamation mark on my iPad Launch Image mean?

I am converting my iPhone app to a universal app and just added the launch image for the iPad. The image works fine, but in xCode there is a large triangle with an exclamation mark in it. What does this mean? I thought it might because the file size was too large? I reduced it from a meg to 168k and the triangle is still there.
Thanks,
John
It most likely means that the image dimensions are wrong. They should be 768 x 1004 (W x H) for an iPad launch image in portrait. For landscape it should be 1024 x 748 (W x H).
You should also be able to hover over the yellow triangle to see the same error.
Apple's guidelines for launch image size are here: iOS HIG, Image Sizes.

will my apps work on iphone OS4?

Screen resolution has increased in iphone OS4. Since lot of UI stuff have hardcoded co-ordinates, will my app run properly on OS4? I still haven't got Snow Leopard, so cant test run the simulator for OS4.
It is publicly known that the number of points vs pixels is 2:1 so point 320 has 640 pixels in hi-res and 320 pixels in low-res. Low resolution images will be somewhat jaggy, but their positioning on the screen would remain the same.

Resources