1

I hope this is the right place to post a question like this. Apologies if it isnt. I am having an issue displaying images. I want to display 10 images in a UIScrollView with paging enabled which are roughly 1mb in size.I am using lazy loading based on this example: http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content . Is there a way to reduce there size that will keep as much quality as possible? It does not need to be done in code either, if there was a good compression site that could do it it would be great. I dont have much experience dealing with images.

For example what should i be looking out for?

DevC
  • 6,982
  • 9
  • 45
  • 80
  • use this link http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk – Anbu.Karthik Apr 28 '14 at 09:39
  • possible duplicate of [Present and zoom large images on iOS without CATiledLayer](http://stackoverflow.com/questions/8996268/present-and-zoom-large-images-on-ios-without-catiledlayer) – Wain Apr 28 '14 at 09:45

3 Answers3

1

Use slender mac app for removing unwanted files and resizing image. Its handy application in every manner.

EDIT : Best tool for resizing images is imageOptim does the same and is free.

Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
  • Making the file size smaller does **not** make the loaded image in memory any smaller. – rckoenes Apr 28 '14 at 09:44
  • yes it makes [UIImage imageNamed:@""] caches exact amount of size of image; – Paresh Navadiya Apr 28 '14 at 09:45
  • Any image load in a `UIImage` object will make it bitmapped, thus thus the size of the image in memory is `height x width x 4 bytes`. The 4 bytes are red, green, blue and alpha. So even though the size on the file system might be less when loaded in memory it will be the same. – rckoenes Apr 28 '14 at 09:47
  • I downloaded the trial of Slender Mac app - very useful too regardless – DevC Apr 28 '14 at 09:53
0

You can edit images both programmatically and using other applications. If you optimize the images by code you will anyhow have to store it in the app thus increasing the size of the application so it is better to optimize and then add it to the project.

As easy to use website to optimize images is https://tinypng.com/

NKB
  • 651
  • 5
  • 13
  • See my answer below, make the file size smaller does not decrease the memory usage of an `UIImage` object. – rckoenes Apr 28 '14 at 09:49
  • Thanks @rckoenes I had not known this. – NKB Apr 28 '14 at 09:50
  • @rckoenes thanks for the advise. Is it true however that there is optimisation in the iOS system for png images? So the smaller the png the quicker? – DevC Apr 28 '14 at 09:55
  • @Gman Yes and No, read [Image Decompression Benchmark](https://www.cocoanetics.com/2012/12/image-decompression-benchmark-ipad-4-mini/) blog posted. There is some optimization, but not always in the way you expect. Also all images type go by the same rule for memory usage. If you need to get you memory usage down, use small image in resolution. – rckoenes Apr 28 '14 at 09:58
  • @rckoenes thanks! Ill have a read. Is there any negative/noticable effect if I only use standard images in both the iPhone 4 and iPhone 5? I am assuming pixilation will occur? – DevC Apr 28 '14 at 10:03
  • No since the iPhone 4 and 5 are both retina screens. – rckoenes Apr 28 '14 at 10:07
  • @rckoenes this may seem like a 'noob' questions but are '@2x' required for an app? Or is it only optional – DevC Apr 28 '14 at 10:18
  • @2x is required by apple. – rckoenes Apr 28 '14 at 10:39
0

try Photoshop save as web & devices and save as PNG or jpg, and check the quality of both, you will be surprised.

Manolo
  • 469
  • 6
  • 20