Skip to main content
Known Participant
September 18, 2019
Open for Voting

P: Allow JPEGs to be embedded, to save disk space

  • September 18, 2019
  • 54 replies
  • 4196 views

Problem:
Let's say my client sends me a 4Mb JPEG file which needs retouching for a project. I open it in Photoshop, add a couple of simple adjustment layers, and save the image as a psd. The resulting file is now 65Mb. This waste of disk space is totally unnecessary, since all I've added to the image is a couple of adjustment layers. And if I'm working on, say, a magazine containing hundreds of photos, the amount of wasted space really stacks up.

Solution:
Whenever you open a JPEG in Photoshop, it appears as an 'embedded JPEG layer'. This operates a lot like a Smart Layer. You can apply effects to it, but the layer itself is not regarded as editable bitmap data (unless you rasterize it). Then, when you save it, the original JPEG remains embedded in its original JPEG format, so if you haven't added any raster layers, the file size should be only slightly larger than the original JPEG.

54 replies

Known Participant
September 20, 2019
"They will never change out of rastor", I think you are confused about what I am suggesting... I'm not saying Adobe should change to some non-raster format, or even change anything about how they embed smart objects.

What I am saying is that when a file is saved, completely omit the pixel data from smart object layer instances. Don't save the layer pixels at all. When you re-open the file rebuild that raster data again. 

"Your file may have many layers or it's big but it won't save any quicker without a container file and we haven't used those since 2005.", Yes, it will save faster, assuming the process above. Fewer pixels to compress and write when saving. Especially if you have a lot of very large, duplicated smart object layers referencing the same object, like you might find in a print ad with heavy text effects.

I'm not suggesting we change to containers or new file formats or anything except zeroing out the pixel data on smart object layers when a file is saved and triggering a refresh when loaded. With all the pros and cons that might come with that.
Legend
September 20, 2019
I find none of those to be useful and I'd rather that development time wasn't wasted there.
stevel24076854
Participating Frequently
September 19, 2019
Max,  "Steve. Read before trash-posting. I laid out the file specs" 
Gee thanks for that.  I am only trying to tell you something better.  

They will never change out of rastor.  And, I am not trash talking. I think others carried my thinking as well about this.  I am always direct to the point as all engineers at Microsoft are this way.  Apparently I am new to you, so sorry if my direct response hit you wrong, but I think most of us have been trying to tell you the same thing.   

Your file may have many layers or it's big but it won't save any quicker without a container file and we haven't used those since 2005.  I have a list of 200 file formats including containers and only 7 of the containers are for video only, not for your regular files, and embedded files could be as bulky and slow your system.  An embedded operation can make your software more bulky and with 200 or more of those files.  Your software will begin to load slower.  I am not sure if you know this, but you may not be happier with its result even if there was a change in the software, as it may disappoint you greatly.   
Known Participant
September 19, 2019
I would also point out that Adobe has a vested interest in making file sizes more efficient with the big push to cloud documents and CC Libraries.

When you start thinking of file size in relation to having to save up and down from the cloud every time, the difference between 5mb and 125mb looks a lot more significant.
Known Participant
September 19, 2019
The OP suggests embedding the JPEG as a JPEG (which is already literally how embedded smart obejcts work) and never says the main doc should be saved as JPEG with layers... it is a bit unclear... but I read it as how he introduced the example:

I open it in Photoshop, add a couple of simple adjustment layers, and save the image as a psd.
and 

 let's say you bring several JPEGs into a Photoshop document, convert them to smart objects, duplicate, flip, rotate, and warp them? If you save this as a Photoshop file, the file is huge.
But if all the original JPEGs were retained as JPEGs, the file size would only be a little larger than the original files. It's a much more efficient way of storing the images.
which is all how photoshop already works... the large file size comes from the rasterized pixel data in each layer that references the already very small actual embedded jpeg. As I proved in my test below...

So if you emptied out the rasterized pixel data on every SO layer before saving, you'd get the base file overhead + the tiny jpeg being compressed and saved.

Known Participant
September 19, 2019
Steve. Read before trash-posting. I laid out the file specs
I saved out three versions of the same base file:
4000x4000px PSD file saved from CC2019
Added one 1334x750px (240kb) JPEG as a smart object 
4x copies of the smart object with varying scale and rotation transformations applied.
When I mention save times, it's as a side bonus. That's totally beside the point of the OP. But since you are a Windows engineer, you have to admit that it will necessarily become faster if you drop the rasterized data from those layers. The number of bytes you are processing is much lower. I have files that can take a minute or more to save. No that won't be saving me a hours of time, but I wouldn't snappier saves.

I also noted the load time as a theoretical disadvantage because I have a lot of experience with how long it can take to rebuild the layer previews when I update and save a smart-object.
stevel24076854
Participating Frequently
September 19, 2019
Eartho I can't believe I am replying to your suggestion but it's good.  But container formats are used for video.  Not many containers are being used for JPEG files. 

There is one which Adobe uses for illustrator with .flt (FLT)which is a filter that acts as a container format for compressed files.  Definition:  stands for FiLTer; a file extension used in Adobe Illustrator, PageMaker; a plugin container; not directly viewable. 

This may not be used for JPEG as a container in place of utilizing embedded file formats.  It may be useless info but worth a mention.  It's the only active container left in my list of 200 or so file formats.  All others are container files for vids.  
 
Earth Oliver
Legend
September 19, 2019
sounds to me like what they're asking is for being able to save a multi layered psd with SOs and adjustment layers as a jpg? The only way i could imagine such a thing is that basically the psd would be a container for a layered file which contains only the adjustments and then a blank linked layer that references the jpg which is contained in the new container format. 
This is really very specific use kind of thinking and is a real waste of our time to even think about. 
A better approach for Adobe would be developing a resolution independent platform which we had back in the 90s with Live Picture. 
But spending resources trying to save a not-jpg as a jpg? Wasn't there a season of Silicon Valley which flirted with this idea?
stevel24076854
Participating Frequently
September 19, 2019
Jim, Max,

125 Mb for a JPEG?  What's the length of the photo, 9 blocks long? 

Even if you saved that embedded, it would take as much time to save it so it does not make any sense.  Oh and BTW, being a Windows engineer, I need to tell you that Windows does not dual-task, so your file save will be the time it save as you disrupt other apps on the system. 

And what are you looking to save in time?  1/10th of a second on the saved file?  Now multiply that by the number of the users who would be interested, and tell me if it's worth Adobe's time to make that happen?  Not if it doesn't work in the first place it won't happen.  It's not worth it. 

Do you have a bus to catch?  Time is money?  What's the difference will saving 9/10th of a second help you?  What other tasks do you need to get to that's more important? 

If Adobe made this change, developers will keep asking themselves "what are we doing this for again??" 

If you can make sense out of it, maybe they will perk their interest but I con't see any interest with a 9/10th of a second difference.  And then, developers need to put 2 months into the programming and test engineers, then there's the expense for it all.  It's not justified for the expense or time.  

Steve Lehman, mcse



September 19, 2019
nice test.  Thanks.