Are there known issues with PNG and JPEG images generated on iOS? - ios

I got the brilliant idea to generate the app store screen shots for my app from... and app! This works great, except for the fact that some of the PNG or JPEG images are not recognized as valid screen shots when I try to upload them. I checked with image viewer, and they have the required size, colorspace and pixel density.
Is there perhaps some strange issues with PNG and/or JPEG images generated on iOS?

Related

PDF vector graphic smaller than the png at same size

I converted some SVG images into PDF and png files for my iOS app. When adding them to the UIImageView, the pdf images look smaller than the png equivalent. The scale type was set to center, so no scaling happens at runtime.
btw, the pdf and png look the same when I open them in preview and adobe reader
Anyone had same issue and got a solution for that?
When converting an SVG to PDF, make sure the DPI is set to 72. That way, the size will match with the PNG resource that you have. Xcode actually expects vector-based resources to be 1x in size.

jpg or png for user profile pictures?

My app requires that each user has a profile picture of around 140*140px. Right now I am using jpgs, I am wondering if performance wise it will be better to use pngs. I read pngs are good for small UI elements and images, jpg for large images with detail such as photos. Obviously my profile pics are photos but they are small. Would it make much difference switching to png? Thanks
JPEG is best for small file sizes of photos, even for low resolutions.
PNG makes sense when there are many pixels of the exact same color next to each other. This is not the case with photos.
These should be helpful for you.
When to use PNG or JPG in iPhone development?
PNG vs. GIF vs. JPEG vs. SVG - When best to use?
Apple optimizes PNG images that are included in your iPhone app bundle. In fact, the iPhone uses a special encoding in which the color bytes are optimized for the hardware. XCode handles this special encoding for you when you build your project. So, you do see additional benefits to using PNG's on an iPhone other than their size consideration. For this reason it is definitely recommended to use PNG's for any images that appear as part of the interface (in a table view, labels, etc).
As for displaying a full screen image such as a photograph you may still reap benefits with PNG's since they are non-lossy and the visual quality should be better than a JPG not to mention resource usage with decoding the image. You may need to decrease the quality of your JPG's in order to see a real benefit in file size but then you are displaying non-optimal images.
File size is certainly a factor but there are other considerations at play as well when choosing an image format.

Saving image to camera roll in iOS Safari always converts it to jpg

In my web app (runs in native Safari not UIWebView) I am using canvas to basically allow to draw an image. The user should then be able to save this image to his computer, however it's very important that this process is lossless. That's why I am using the PNG file format.
All this works perfectly on desktop, and in theory it should also work on iOS because by tap and holding the resulting image can be saved to the camera roll. The problem occurs if the image is later imported into the app again. On inspection of the uploaded image type you can see that the image is now in the JPG file format and no longer a pixel perfect representation of the drawing the user made.
Is that a general issue with the camera roll on iOS? Is there any workaround?
YES, The default file format is JPG while saving image to camera roll. You can save a image in PNG format in a native app by writing some code. But in Safari, there may no be possible to save as PNG format.

Large sizes in iOS Universal apps due to a million images

Ok, I have a universal app, which means it has to have an iPhone non-retina launch image, retina image, and iPhone 5+ size retina image. It also has to have non-retina iPad launch for portrait and landscape, retina for portrait and landscape, and then alternate versions as well with slight changes to dimensions. For example, on iPad I have to have a 768 x 1024 and a 768 x 1004. With 8 images required just for the iPad launch image, the file size of my app is huge, as each iPad launch image is between 1.5MB and 5MB. Any suggestions for how I can keep the size down, since it is only high due to large launch images?
Here is what I mean by all the images required for iPad. 8 images???
What you can do to reduce the size greatly is provide jpeg images instead of png. Yeah, I know, Apple asks for png, but you can submit an app with jpg images (I did this for my iPad app).
Use Preview to open the images. save them as JPEGs with a really low quality - or experiment with the quality setting. You will be amazed at how nice a really compressed JPG image can look.
Oh, your launch time might increase by a few milliseconds due to Apple translating the jpg to png during launch.
My experience was submitting when iOS5 was out, so its possible that not using PNG will be a blocker with iOS7. However, I even have a solution if that is needed. Do as I suggest - save the images as highly compressed jpg images first. Then convert THOSE images to pngs - the jpg compression done first should make it easier for png to compress the those images, reducing the size.
There are several PNG "crushers" - programs to reduce PNG size - that work great. Just make sure that you unselect the option to have Xcode "reduce the PNG sizes" - since it actually increases their size!

Hi-res PNG file in ipad's safari

I have some asp.net site that shows png images that converted from hi-res tiff files.
The image is shown via simple img tag. The problem is that wneh png has a big resolution - it does not shown properly in ipad's safari browser, but the most of png files are ok.
What it can be?
Thank you
The iPad cannot display images with a w*h larger than 3*1024*1024 (3145728)
So if your image is 2048x2048 then w*h = 4194304 which is larger than 3145728.
Source: https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html#//apple_ref/doc/uid/TP40006482-SW15

Resources