PNG format is a lossless compression file format, which makes it a common choice for use on the Web. PNG is a good choice for storing line drawings, text, and iconic graphics at a small file size.
Portable Network Graphics is a lossless file format created with the intent to replace the GIF format, due to the patent restrictions of GIF compression. The project was a success and we now have complete access to the format, which is patent-free, has great compression, and is widely supported by web browsers. PNG files are used primarily for transparent images, simple-color images, and images that have hard lines, like text. There are two versions of PNG files: 8-bit PNG(known as PNG-8) and 24-bit PNG(known as PNG-24). PNG-8 is limited to 256 indexed colors, while PNG-24 has millions.
Joint Photographic Experts Group created a file format, creatively named JPEG \j-peg\, to handle complex-color photographic images. When saving a file as a JPEG, users have the choice of quality vs. compression. More compression results in a smaller file size, but you will lose quality. Obviously, less compression results in a larger file-size, but also a higher-quality image. The great thing about JPEG compression is that you can usually find a balance that both looks good and has a small file size. Unfortunately, JPEG files have no transparency. Additionally, the file format is lossy, meaning that it loses some of its data each time it is compressed. If you re-save the same image multiple times for some reason, the image quality may be low.
JPG format is a lossy compressed file format. This makes it useful for storing photographs at a smaller size than a BMP. JPG is a common choice for use on the Web because it is compressed. For storing line drawings, text, and iconic graphics at a smaller file size, GIF or PNG are better choices because they are lossless.
JPEGs are for photographs and realistic images. PNGs are for line art, text-heavy images, and images with few colors. GIFs are just fail.
so why the png presentaion of image will bigger than the image 's rawdata size ?
JPEG and PNG use completely different compression methods. JPEG uses a DCT-based lossy compression method that sacrifices quality in favor of smaller file sizes. PNG prioritizes quality and uses the lossless DEFLATE compression algorithm. JPEG's file size can be cut down by adjusting an image's quality percentage during saving, while PNG's file size is less easily adjusted and usually requires a separate program to further compress the image. check this - diffen.com/difference/JPEG_vs_PNG
is there any way to get a uiimage object's raw data content length ?because UIImagePNGRepresentation or UIImageJPEGRepresentation is not working correctly