I apologize if this is the wrong stack exchange site, but I thought my question might be too specific to photo encoding for stack exchange. I recently recovered a host of digital picture files from a dead drive and after the recovery noticed that although all the photos are the same resolution and are one of three encoding formats (jpg, png, or tif), there are drastic differences in their file sizes. I know the efficiency of the compression can vary to a certain degree between photos, however, there are some as small as 112KB and others into the hundreds of megabytes. With the really enormous files I was pretty confident that the recovery tools just scraped some extra data into the photo files, so I started going through, opening the photos in paint and then re-saving them and files that were up to approx 300MB were encoded at just 600KB.
It got me wondering, if I open two files in paint and they are the same resolution and each pixel is the same color (ie, they look identical), can there be other data behind the scenes I'm not aware of that paint is cutting out that is important to the image, or will the encoding on two files of the same number of and color pixels be the same and result in identical sizes?