The smallest lossless image format and / or library?

I had a problem with image size with my iOS application and I discovered this article finding a solution to optimize image size

After reading, I realized that I do not need to use only PNG or JPEG. In fact, I can use any image format that is not supported by default on the iOS platform. Because if I can get the actual pixels, converting it to UIImage via CGImage is a simple job. I can use a special raster image format and a special decoder. For example, there is a method called texture atlas that stores many images in a large raster image and can store additional duplicate buckets.

So, I ask about the smallest (during compression) compression without compression in the format and / or library. If you know a great format or library, I want you to recommend it to me.

It would be nice if it were open source, but I do not mind if it is closed source and a paid solution. I only need awesome image compression, not source code. Of course, it should be used on the iOS platform, so it should offer a decoder that can be used in C, C + or Objective-C. (I do not need an encoder on this platform)

+6
source share
2 answers

Different images have different compression. With JPEG you sacrifice quality for a smaller size, and with PNG 24 you get alpha transparency. What interests you more is getting the smallest image size for the format you are using. There are 2 great command line tools for this. Somehow you have to play with different types, programs such as photoshop make it easy to see which one is the smallest. Once you find the optimal format, you can use "smusher" to delete extraneous data that is not needed for the image, but is often added by the editor. The following are two command line utilities that I use to ensure that my images are as small as possible when building sites, but are also useful for any application.

optipng: http://optipng.sourceforge.net/ jpegoptim: https://github.com/glennr/jpegoptim#readme

both can be easily installed using homebrew: http://mxcl.github.com/homebrew/ , and I would suggest that this is an option for macports.

There is also C-based, so you can either use it in an iOS project.

+1
source

If you want to optimize JPEG, I would go to http://jpegmini.com

If you want to exit JPEG and PNG, you can try Google WebP (http://code.google.com/speed/webp/), but I have no idea if there are iOS libraries for it, and if they are good ones.

+1
source

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


All Articles