iPhone 5 Web Browser - transparent .png with black matte - iphone

I often use 24-bit transparent .png files in web design. I recently checked an iPhone 5, mostly to look at the viewport, and noticed my .png files all have a black matte?
Went back and checked an iPhone 4 and everything looks fine there. Not sure what to say. I've been saving files the same way since 2007! Either a save-for-web from Photoshop or a direct save-as.
Any ideas? Is mobile Safari the new IE 6?

I looked into this a little more, including testing more than one iPhone5.
It's a colour profile issue saving out of Photoshop. I opened the files and assigned a colour profile (I assigned sRGB to one and colormatch to the other) and they work fine with either.
Normally I use sRGB for all my images, so it's strange, but definitely a local issue to my files, as saved from Photoshop. It doesn't totally make sense to me that the colour profile wasn't there in the first place, but at least I understand this now.
Hope fully it helps someone.

Related

Set image for tab bar IOS

I'm experiencing issue when trying to set png image for tab bar item icon for my iOS application. If I'm creating png image (with transparent background) and setting it, everything works as expected, but when I'm using another png file (created by another person, or downloaded from web) it not works. Actually in my case I'm making png file from .pdf file and it's absolutely not clear for me why this not works. For more information please see screen captures below (top image represents not working one).
Thanks in advance.
Those specific icons/buttons work funky in terms of PNG and transparency for those images. You have to have look at the png's you download in image preview, make sure transparency exists for the white space. If there is whitespace it'll come through and show in your iOS app. Any other nonwhitepsace transparency will show up dark. It threw me off the first time I encountered this, A lot of graphics and PNG's you download from the internet doesn't have transparency built in or they have it very subtle. THose will show up as a blob for your ViewController Tabs.
Here is a good resource and guideline I found: http://steveweller.com/articles/toolbar-icons/

iOS 5.1 with Xcode 4.3.1: [UIColor colorWithPatternImage:] strange behavior only on device

When I compile my app in Xcode 4.3.1 with iOS 5.1, I notice there is a strange behavior with background textures only on actual device. There is a 1px gap in between texture tiles shown in screenshot below.
My texture are 150x150 and 300x300 at 2x.
So far I've tested the same build on:
Simulator iPhone/iPad both 5.0/5.1: No bug
iPhone/iPad running 5.0.1: No bug
iPhone/iPad running 5.1: Buggy
I've been getting the same problem since 5.1 aswell. I solved it by doing the following to the image in photoshop. You can probably do the same in another tool.
Load the file, select all, and copy to clipboard
Create a new file in photoshop that is the same dimension, RGB and 8bit depth with 72pixels/inch resolution with a white background.
Paste the image you copied in step 1 into this image
Save the file and use this one.
After doing this the file displayed correctly on the device and I didn't have to resort to creating images the size of the display.
My workaround:
Set "Compress PNG Files" to "No" in Build Settings. In my case the size of the app bundle was even smaller than with compression turned on. I did image optimization myself.
just in case anyone else is having this problem and uses pngoptimizer, try a new png without optimizing it.
I had the same problem and spent the last 4 hours trying to solve it.
In the end i realized it was png file from the pngoptimizer tool that somehow always worked before iOS 5.1 but with the update the same png file produces this thin line at the bottom. the strange thing is that this does only happen on the device and not in simulator and that deceives you a lot because you think it cant be the graphic. in fact it is.

Will images look different from the iPhone Simulator to an actual iDevice?

Images that I add to the layer in Cocos2d look pixelated around the edges of the image (i.e. a hillside, the rounded part of the hill, where the sky and the hill meet). I don't know if it's the image quality, or just because the graphics processor on my 'older' MacBook Pro is not as advanced as the iPhone 4 or iPod Touch 4 or iPad 2. Is it because of that?
I have ran into an instance where a large resolution image was being used in the context of a locally packaged HTML file in a UIWebView. The image looked fine in the simulator, but when ran on a hardware device, a bug was exposed in the rendering engine where it would invert the colors. Here's a bug report as an example of this. The solution was to scale the image down a bit in photo editing application.
While an extreme corner case, this is an example of the simulator not quite living up to how things will work on a hardware device.
The simulator usually does a pretty good job representing what the final image will look like. For the image quality on a normal computer to be worse than that of an iPhone for it to make a large enough difference, your MacBook Pro has to be really bad. So I doubt it.
However, if you really want to make sure, the best way to check would be to transfer the image you are using to another machine to see if it still looks pixelated. If it does, its a problem with your image.
Hope this helps and good luck!

iPhone screenshot different colour when displayed

I've taken a screenshot of my iPhone app running and I'd like to use that image as a png to be drawn by the app instead of generated graphics.
When I take the screenshot, it looks fine. However, when that is saved as a PNG file, added to the Xcode project and then displayed back on the screen of the phone (or simulator) the colours are different.
Can anyone explain to me why it's changing? (I'm guessing there's a colour space conversion happening).
How can I stop this from changing?
You might be saving the png image with some incorrect settings which is either reducing the quality or number of colors used. Try the PNG-24 with transparency to see if that helps at all.

Why do .png backgrounds appear black on iPhone device but not simulator?

I started with a .tiff file and used GraphicConverter to change it to a .png and set a transparency color. Worked fine in the simulator but when I pushed to the device the transparency color became black. Tested with a .png I downloaded from the net and that worked fine, so it seems to only happen with some files. Thus I suspect it has something to do with the way GraphicConverter writes the .pngs, but I don't know enough about file formats to debug it. Any ideas/suggestions? Ideally I'd like to programatically treat all .pngs because my app allowed dynamic loading of arbitrary files, so I can't verify the transparency beforehand.
PNGs, like most other image formats that support transparency, seem to have multiple ways to handle the alpha channel. Apple recommends the PNG-24 format; perhaps GraphicsConverter gave something else?
You can use Preview to convert your image files. The iPhone should like it better. Just open your file and Save As.