Photo compression is the method of minimizing the size of a graphic without compromising the quality of the image. Reducing the size of the image gives you more disk/bandwidth space. This also lessen the time to send the image online.
A compressed photo is way smaller than the raw photo. In this case, your memory card can accommodate 10 uncompressed photos while it can hold 100 compressed ones. You have more value of your memory card now with the compressed photos.
On a mobile phone, you might want to view a photo from the internet but with the raw photo, you need to wait for 5 minutes instead of 1 second when you view a compressed photo. This way, you can also add value to your data plan and save you more time.
There are 3 most common file types on the internet these days: JPEG, GIF and PNG. GIF is a bitmap image format which supports up to 8 bits per pixel. This means that the image can have up to 256 RGB colors. JPEG is a format that uses lossy compression to make smaller sizes of a file. It allows the web designer to balance the compression being used which results in a better quality of the image. PNG is a bitmapped image that uses lossless data compression. This was also created to replace GIF image format. PNG was previously not supported by internet browsers, making JPEG and GIF the commonly used format. However, PNG is not being supported by most browsers. The biggest advantage of PNG is supporting a number of transparency options like the alpha channel transparency. You can also convert PNGs to PDF, there will be another article on how to convert PNG to PDF on Windows.
The formats mentioned above are needed for different types of images. It is just important to choose the correct format to produce high quality images and file sizes that are smaller.