Xcode 6 - Images Xcassets - Images size and devices Resolutions - xcode

I am trying to understand what's going on with the new resolutions on all iPhones Devices (including 6,6+).
I read this one http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions but I still don't understand what's going on.
For example:
I have an image view which it should be full screen on each iPhone above iPhone 5. I created an Image Xcasset with 3 sizes: #1x, #2x and 3#x.
What image sizes should I add in Xcasset to support iPhone 5,5S,6,6+?

Related

APNG files not working in Xcode for iMessage Stickers?

I'm having trouble getting .APNG files to work - they preview correctly in Firefox (meaning when drag'n'dropped into a Firefox window, they animate the way they're supposed to) but when I drag'n'drop the same file into xcode, I see only the first frame. No animation. When previewing in a simulator, no animation - just a static sticker.
The same files animate correctly in an iMessage timeline when sent as attachments (like animated GIFs)..so the files are good.
Also, it's not a size issue - one of them is 16 Kb, and about 400x260. Some are larger in file size but smaller in frame size, none are over 350 Kb.
It's just Xcode that doesn't like them.
I know how to make animated sticker packs - I have two for sale already. For those, I used PNG sequences. I'm trying to use .APNG files because I'm getting way better compression.
I've used PNG Animator as well as apngasm to create the .APNGs, and they are all at or under 300 Kb in size, and under 600 pixels in size.
Is anyone successfully using .APNG files for creating animated stickers?
KM
https://itunes.apple.com/us/app/markup-stickers/id1157027020?mt=8
UPDATE! GOT IT TO WORK!
I needed to import them as stickers, or static image files, and NOT as a sticker sequence, and also needed to name them .PNG and not .APNG.
Success!
KM

Appcelerator - Saving image to a file from ImageView with fixed resolution

I am trying to save the content of an ImageView into a file and save it as an image. The simple code snippet which I am using is:
writeImageToFile(imageView.image);
The function writeImageToFile, saves the blob in a file which contains the image displayed in the image view. All good and fine till here.
Now the point noticed in here is that, I have defined the ImageView with the width and height as 150dip. After saving the image into a file, for iPhone 5, we find that the image resolution is 300x300, and for iPhone 6 Plus it is 450x450. The image resolution varies with the screen density, which I can understand.
But my query is that is there any way to always keep the resolution fixed to 150x150 pixels. Am not sure if this is possible out of the box with Appcelerator or do we need to use external modules.
Note: This is also applicable for Android too.
You can use the Blob functions to check the image size, then decide if you need to resize. You can use imageAsResized (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Blob-method-imageAsResized) to make a 150x150 image.

Retina version of an image always used on non-retina display

In Cocoa application I've got 16x16 and 32x32 #2x version of an image: . When the image is displayed in NSImageView Mac OS X always picks higher-resolution version (i.e. downscales the #2x image on non-retina displays instead of using the 1:1 version).
(IB on the left = good, running app on the right = downscaled mess)
Of course I've got both images added to the project (as image.png and image#2x.png).
If I delete the #2x image from app bundle then OS X will display the lower-resolution image.
The bug happens regardless whether Xcode (4.6.2) combines them into a .tiff or not (and I've checked that the combined .tiff contains both images).
Oddly this happens only with this particular image. Other 1x/2x images in the same project are displayed correctly matching screen DPI.
How is that possible?! Do images have to meet some special criteria other than size and filename pattern?
Mystery solved: OS X doesn't like mixed types of PNGs.
$ file *.png
image.png: PNG image data, 16 x 16, 8-bit gray+alpha, non-interlaced
image#2x.png: PNG image data, 32 x 32, 8-bit colormap, non-interlaced
if both files are forced to use same color mode (i.e. both gray or both paletted) then OS X selects images correctly.
It turns out to be the NSImage’s prefersColorMatch property [1]:
The default value is YES. Both color matching and resolution matching may influence the choice of an image representation.
It is possible to set to NO in User Defined Runtime Attributes in Interface Builder [2].
[1] https://developer.apple.com/documentation/appkit/nsimage/1520010-preferscolormatch
[2] Are specific PNG compression types incompatible with macOS Cocoa apps?

cocos2d, how to upscale images automatically for iPad

I was wondering if there is a way to upscale image automatically for iPad and if so how. Or if it is recommended to do individual images how do I make cocos2d recognized iPad images?
Upscaling images is not recommended. For the simple reason that you won't gain any quality (in fact, you'll lose some). Scaling on the fly via scale property can be done, but again you lose quality and in this case also performance.
Instead, use a tool like TexturePacker, design your images in the highest possible resolution and allow TexturePacker to handle the export and downscaling (that's ok) of your assets to the lower resolutions.
Raj already answered the file suffixes.
Use following extension for image.
background.png - for iPhone SD (480x320 )
background-hd.png - for iPhone HD (960x640 )
background-ipad.png - for iPad ( 1024x768 )
background-ipadhd.png - for iPad ( 2048x1536 )

Concerns about resolution size Xcode

I have two images, one image is 320 x 480 called image.png and while the other is 640 x 1096 called image#2x.png. Will my app get rejected for not being exactly twice as big as the original? I have no choice it would seem if I need to fit the image on iPhone 5. Any tips or suggestions will be most appreciated.
Your naming convention is incorrect.
There is a strict rule of image file naming.
For iPhone 3G/3GS with resolution 320x480, your image should be named as image.png
For iPhone 4/4S with resolution 640x960, your image should be named as image#2x.png
For iPhone 5 with resolution 640x1136, your image should be named as image-568h#2x.png
This question is a duplicate of --> iPhone 5 - what naming convention the new images have to follow?

Resources