Slains Castle

by pakman

submit your photo

Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Sign up ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

I have jpg photos with frames put on them which a friend made for me. I noticed when I open the jpgs though, that the image loads first and then the frame loads on top of it (that is, I can see the parts of the image which are hidden underneath the frame before they actually get hidden).

This is confusing to me though, since I thought jpgs don't have layers and are flattened. Does anybody know what I'm talking about? Do jpgs actually have layers?

share|improve this question
(ha, your question made me look like your avatar) … Does the hidden "layer" look like the JPG's thumbnail? Could the software you're using first show the thumbnail while it is loading the real image? – koiyu Mar 9 '11 at 15:20

3 Answers 3

up vote 17 down vote accepted

Not really. Weirdly, "jpeg" is really the name of the compression and not the standard for the file format that bears the .jpg name. There's various different container formats that can hold jpeg-compressed streams. The official one is JFIF, although by strict reading files containing EXIF data don't properly correspond to that spec. (Aren't standards awesome?) This format specifies a single frame of data. There's a new format called JPEG Multi-Picture Format which can hold multiple frames, but those can't be read by normal JPEG viewers (and are apparently normally labeled .mpo).

However, regular JFIF/JPEG-EXIF files can use either a "standard" layout or a "progressive" one. In the progressive format, a lower-resolution stream is rendered first, and further data is filled in from later bitstreams in the file. It may be possible to abuse this such that the "overlay frame" is only in the final stream. But display of this would be strongly dependent on your viewer. On a fast system with the file cached, it'd basically all load at once.

share|improve this answer
+1 for the idea of abusing the interleaved format (I believe progressive should display the whole image in a linear manner, am I correct?). However, the caching is not the only thing that may affect the apparent result. If the viewer is "stupid" enough, then subsampling the image (for reducing its size for display) can actually eliminate the frame altogether (aliasing). – ysap Mar 9 '11 at 18:51
One possibility is that rather than being some sort of wizardry exploiting the progressive format, fine detail on the "overlay" frame simply isn't as visible on the early progressive passes, giving the illusion that you're not seeing it. – thomasrutter Jun 30 at 4:07

JPEGs do not, to the best of my knowledge, have layers. They do have progressive encoding whereby a series of lower resolution versions are displayed as the data is arriving until all the data is there and the final full quality version is displayed.

My best guess is that what you're seeing is an artifact from this process, though if you could post the image I could do better than guessing!

share|improve this answer

At least in my computers (Windows, various versions) editing a .jpg file in Photoshop and saving it creates a situation where, if there is some type of embedded thumbnail, Photoshop does not update it, later on while viewing the file in another program (Windows Image Viewer for example) the thumbnail is loaded first and shown (upscaled to fit) while the program processes the compressed jpeg data to create the full resolution image.

Most of the time, these programs are not fast enough so that the eye almost always catches the enlarged thumbnail before the actual image. In my case, I get to see the (yet) uncorrected colors, the uncropped framing, etc. (I.e. the image lacking whatever changes I made in Ps).

This is no anoyance (for me) at all, but I have seen that using "Save As" with a different name, instead of the regular "Save" avoids this situation.

What leads me to think that there is a thumbnail embedded in the metadata segment of the file is that if I transfer the edited file to a computer where no previous version of the image exists, the "original ghost" can be seen when opening the picture.

Another option that avoids the issue is saving a file with the "Save for Web" command. This uses a routine that somehow compresses the jpeg a little bit more while apparently not reducing the quality so much. Part of the algorithm includes striping most non-image data before creating the new file.

When I do this, I notice the Windows Picture Viewer takes a little extra time before showing anything at all, specially if the file was not created using "progessive" in the "Save For Web" dialog.

P.S. Windows usually creates a thumbnail database for folder that contains only pictures or mostly pictures. Editing a picture, or overwriting the file almost always makes Windows (At least XP & Vista) show the incorrect thumbnail when browsing the directory in Windows Explorer. I'm aware this is a totally different problem and seems to be unrelated to the issue described by the O.p. When this bothers me enough, I delete the hidden "thumbs.db" file in the offending folder then switch the view mode to anything but Large Thumbnails and then back to that. This forces the creation of a new thumbs.db file that should use the actual data from the files in the folder.

share|improve this answer
The JPEG/EXIF standard does indeed call for a thumbnail, but it is ridiculously small — usually 160x120. So, programs usually ignore that and create their own database of thumbnails, like the thumbs.db you noticed. – mattdm Jun 29 at 4:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.