TransWikia.com

Do jpgs have "layers"?

Photography Asked on May 22, 2021

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?

4 Answers

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.

Correct answer by Jahaziel on May 22, 2021

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!

Answered by Matt Grum on May 22, 2021

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.

Answered by mattdm on May 22, 2021

Try deleting the extension in the filename and see if it still opens. Sounds to me like file is behaving like a PDF. If you are hiding extensions on your OS, it could be that the file is actually "FileName.jpg.pdf" or other scenario similar to this whereas the naming convention does not actually represent the file type.

Answered by just a guess on May 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP