Red and Blue

by Gordon

submit your photo

Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
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

2 Answers 2

up vote 16 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

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

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.