Compression of images for universal application

I am working on a universal application with a large number of background images (the total size of one set of background images is ~ 5 Mb, 3 platforms * 2 orientations = 6 background images per screen), there is also key frame animation, and I want to make my application not very scary. What tricks did you use to make your images not too heavy?

My ideas:

  • Universal images for iPad / iPhone 4? β€œI thought that if I used iPad images for the iPhone 4, that would look nice.”
  • Square images instead of using Vert / Horiz background images.
  • Package of images . I plan to compress all my images before adding to the application. Does it work for you?
+4
source share
1 answer

Obviously, this is always a compromise between memory / speed / size. This means that you mentioned the same methods that I personally use. This is how I see them:

[PNG images] (for speed) and [JPEG images] (for memory / size)

[SQUARE images] (for size) and [INDIVIDUAL images] (for memory / speed)

[UNIVERSAL images] (for size) and [INDIVIDUAL images] (for memory / speed)

[CROP images] (for memory / size) and [REGULAR images] (for speed)

[STREAMS] (for size) and [TURN ON IMAGES] (for memory / speed)

As for the image package, Xcode does its own compression and deletion of data. However, I have not heard much about how effective it is. I personally just open everything in Preview and save again to check if there can be less.

Method number one (only if possible, obviously) most definitely uses stretchable images, either fitting them to borders, or using stretchableImageWithLeftCapWidth: topCapHeight: (but, unfortunately, this is usually not an option, only for border / gradient background)

0
source

Source: https://habr.com/ru/post/1338746/


All Articles