complication image is displaying too small - apple-watch

I have a watchkit application with an image. when I place the correctly sized (52x52 pixels for modular small 38mm) image into the correct place in the asset catalog the image displayed is very small, but when I just use a huge version of the image it is scaled down to the size I would expect:
any ideas/tips of how should I prepare/use correctly sized images for complications if I don't want to just go with the huge version?
source code: https://github.com/bazik123/Wristlight
ComplicationController.swift -> func imageNamed()

I had a similar issue and it ended up that the resolutions of my complication images were too high. I had them at 300 and reduced them to 72 using Preview and then they looked perfect!

Related

Want to resize a image with better resolution in swift

I have a image which is uploaded in the image cloud-cloudinary using the API.The response of the upload gives me the cloudinary uploaded url.
Example of one image is as given:
This image is of 120*67 which is uploaded.Now in my app,it looks like this.
The width of my image is as per the phone screen width and the height is fixed to 324.Now i want to resize this 120*67 image to the width and height of my image in the app without losing its clarity.I have made the content mode as scale to fill for the imageview.
Generally, scaling up (non vectorized) images without compromising their quality is not possible (without machine learning). Some software programs have complex algorithms to help with upscaling, but that's also to a limited extent.
You should upload a larger version of your image to Cloudinary, and request it downscaled to the desired resolution.
You should also check out responsive layout design.
If the image is vectorized (e.g - SVG), you need to make sure you're not requesting a rasterized version of it. I.E -
https://res.cloudinary.com/<cloud name>/image/upload/fl_sanitize/<image name>.svg
will keep the image vectorized.

Do you need to have images be at 3x size in my Cloud Storage for iOS?

I am loading images into my app from Firebase Storage and want them to have the highest resolution possible without loading a massive file size. In my app, I am displaying each image at 100x500. In Firebase storage should these be set to 300x1500 (3x the pixels they will be shown at) or does that not matter and saving them at 100x500 will have the same resolution as 300x1500?
I ran a test on my iPhone with 100x500, 300x1500, and then the max (same aspect ratio). The 100x500 was blurry and the 300x1500 and max both looked identical. Based on this, I'd say you do need to have the images as 3x size

Reduce app size cocs2d iOS

I am new with cocs2d. I have created an app using Cocos2d. The app is working fine but problem is that application size is too large 350MB. There are many images in this app. I have used png and where possible jpeg images. There are many png images that have larger than 1 mb.
Is there any way to reduce the application size. I've reduced the size whereever possible. Is there any other format that can be used in place of png? There are no many animations. The png are used only purpose of transparency.
Your images are way out of size. Even if you put them on server, and then download it will take time to download.
The best option is to reduce the image size. A couple of sites that can help you do that are:-
Reduce image size
Compress image size
You can keep the image content on your server and then download the image content asynchronously (which is more imp download it first). If there are levels then download initial levels first and download remaining on the background thread. You can always display a loader on launch and display some help kinda stuff meanwhile the data gets download and cached.
You can make use of SDWebImage and other libraries to get your images stuff async.
Hope it helps.
While your pictures are fairly large and you should try to reduce the number and size, you can make gains through packaging the .png into pvr.ccz files. There are multiple different programs available to do this. I like to use Texture Packer which is available here: http://www.codeandweb.com/texturepacker
You can find some tips in my post on reducing memory usage & bundle size.
Most importantly use texture atlases in .pvr.ccz format and where possible reduce image color depth to 16 bit. Avoid JPGs altogether because they're terribly slow to load in cocos2d.
There is no issue in using png files although your images are too large, You can reduce their size by 70 - 80% by using tinypng and it will not going to hurt your graphics.
https://tinypng.com/
I usually edit the image size now https://resizeimage.io , you try!

iPad retina landing page size - 2MB

The landing page for an ipad retina (i.e 1536 x 2048) is about 2MB. Apple seems to mandate using a PNG for landing pages. Is it possible to reduce this file size? (my landing page is really simple already)
actually the byte size of image not only depends upon the resolution but also on bit depth.
e.g. 100x100 PNG 16bit/24bit
you can reduce the bit depth of the png if you feel like it is not affecting the image quality and if you do find the image quality becomes unacceptable on reducing bit depth then your image is not that simple.
you can also use colors/gradient instead of an image so that you can completely remove the image
you can also use the tiled image (if it suits you) and can keep a small image in the resources.
see... you have lots of choices my friend..!!
I am using ImageOptim to reduce all my images. Works great and fast. Just download, open and drag and drop a folder or all your images onto the interface.
http://imageoptim.com/
There is even a case study on how well this tool can be used to shrink your iOS-Apps:
http://imageoptim.com/tweetbot.html
Use Image Optimiser. You can optimise image online.

Can we use higher resolution images in UIImageView?

Is it possible to use higher resolution images as it is i.e 1800 *1200.
After checking with instrument come to know. image unpacking is done by [ width * height * 4 ] and in this case it takes 8 MB.
Problem comes when we have two UIImageViews and both are holding UIImages with 1800 * 1200 res.
it is clear application will crash due to low memory. is this default behavior of UIImageView / UIImage
Because of this following things comes in focus
You cann't use higher resolution images.
If you want to use higher resolution images , then need to scale it down.
Thanks,
Sagar
There is a sample called PhotoScroller in Apple's Reference Library. It provides a way to display big images in chunks (tiles). That should do what you want.
You can if cut the images up into tiles. Since it isn't possible to display the entire 1800*1200 image at once you can just display the bits that are actually visible and cache the rest to disk. This is similar to how Google maps works.