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

  • 2
  • Idea
  • Updated 2 months ago
  • (Edited)
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.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes

Posted 2 months ago

  • 2
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 902 Posts
  • 230 Reply Likes
Photo of Max Johnson

Max Johnson, Champion

  • 596 Posts
  • 314 Reply Likes
I was just going to say that this functionality sounds a lot more like basic lightroom work than photoshop...
Photo of Roland

Roland

  • 29 Posts
  • 2 Reply Likes
As long as Lr has no layers like Capture One, you must use Photoshop for this. Or Capture One 12.x of course, which is btw. much faster than Lr (Lr: speed a chemical rockets 21st century, C1: warp drive) and a light years ahead developing engine, specially if it come to de-noise and double specially on Fuji raw files. Have also a look at the "Refine Mask" feature of C1, it is freaking awesome good. But C1 has unfortunately it's own super ugly misconception, you can not export the tweaking you made to am xmp sidecar file like in Lr or Bridge+CameraRaw. Somehow it's a bout time to start a partner Youtube channel to "Camera Conspiracies" named "Image Editor Conspiracies" ;)
Photo of Roland

Roland

  • 29 Posts
  • 2 Reply Likes
PS: masks in Lr/CR do not offer all possibilities, I personally missing mostly HSL in Lr/CR masks. In C1 I have each layer full access to everything.
(Edited)
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
Regardless of if the idea is implemented, there are a couple things at play here that could be exploding your file size... and what version you are using.

1. Uncompressed .psd files vs compressed psd files. See what happens if you save as a .tif with zip compression instead?
2. Ancestor metadata bug: PS CC 2017 and I think early versions of 2018 had a bug that would add 10-15mb of corrupted metadata to any saved file. Are you using the latest version of photoshop?
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
Thanks for the replies.

Lightroom is only relevant to very superficial retouching, but 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.

You suggested saving it as a zipped TIFF. Not only is this slow, but it only brings the size down from 66 megs to 50. Not very efficient, and you're needlessly converting a lossy file to raster data, then re-compressing it losslessly. If all the original images stayed as JPEGs, there's no wasted file space!

Which version do I use? CC 2015.

To explain why... I don't believe "newer" is necessarily better. New versions bring whole new bugs and troubles, and lately Adobe has been tending toward making its products uglier and darker, with light text on dark backgrounds, hideous splash screens, and horrors like the new "New Document" dialog. It really puts me off.

There's also the ever-increasing sense of "bloat". 2015 opens really fast. But I have actually tried CC 2018 and it took way longer to open. 2015 just works great for me and does all I need it to do. I will update if a feature gets added that I think may be useful. But that hasn't happened for a long time now.

The 10 Photoshop improvements I'm still waiting for are...

  1. Smart Masks
  2. Proper custom shortcuts (like with all Adobe's other applications)
  3. Ability to launch the program quickly without it spinning up every hard drive on the machine
  4. Small tool to show the current foreground/background color (ideally on the control panel)
  5. Way better scrolling while dragging (scrolling should speed up the nearer you go to the edge)
  6. Fractal-based upsampling tool (similar to Photozoom Pro)
  7. Custom interpolation mode for smart objects
  8. Much lighter interface colors, like classic Photoshop (new versions are so gloomy!)
  9. Custom splash screens
  10. Fix the bug which shows 16-bit documents in only 8-bit when zoomed out beyond 66.67%.
  11. (This.)
(Edited)
Photo of Kepa de Gamboa

Kepa de Gamboa

  • 22 Posts
  • 6 Reply Likes

It will not be me who denies that sometimes Adobe makes strange strokes ... but I would say that some things that you comment are already implemented.

  • 2. Change keyboard shortcuts? That can be done.
  • 3. Install Photoshop on an SSD disk, the performance is greatly improved. The files in use also in the SSD and then to mechanical disks is RAID.
  • 8. Photoshop allows you to change between four tones one of them a very light gray

In options you can also remove the home screen and recover the classic menu to create new documents.
Photo of David Converse

David Converse

  • 731 Posts
  • 219 Reply Likes
I find none of those to be useful and I'd rather that development time wasn't wasted there.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
3. Install Photoshop on an SSD disk, the performance is greatly improved. The files in use also in the SSD and then to mechanical disks is RAID.
Of course I use an SSD. Who doesn't in 2019!? But it's no excuse for sloppy coding. The difference in speed between CC2015 and CC2018 was really significant. Plus CC2018 had an annoying bug on my computer that made dialog boxes invisible in full-screen mode. I was very happy to revert back to CC 2015!
8. Photoshop allows you to change between four tones one of them a very light gray
The lightest option is still darker than it used to be. Plus I'm nervous that Adobe will remove the lighter options completely, like they did with Premiere. Adobe products are tending more and more towards darkness.
2. Change keyboard shortcuts? That can be done.
I mean full customization, like in other Adobe products. Currently, shortcuts are severely limited. I list those limitations here:
https://feedback.photoshop.com/photoshop_family/topics/please-can-you-allow-fully-customizable-keybo...
(Edited)
Photo of eartho

eartho, Champion

  • 1232 Posts
  • 379 Reply Likes
Jim, don't you think that if files could be saved this way, it would have long ago been implemented? There's no such thing as saving layered files out as the original jpgs. Once you've ventured outside what the jpg spec is capable of handling, file sizes are going to explode. Nothing can be done about that until Adobe, or someone, develops a completely new way of compressing and saving multilayered images.

And you start off this thread by saying:
- since all I've added to the image is a couple of adjustment layers.
To which people reply that you could solve this by using Lightroom, which can handle saving adjustments via xmp.

And your reply:
- but let's say you bring several JPEGs into a Photoshop document, convert them to smart objects, duplicate, flip, rotate, and warp them? 

You're going way off the original script there. 

What's the actual complaint/request? You're only interested in saving HD space? If you're doing this professionally, then it's a requirement of the job to have an abundance of available disk space for whatever the work demands. I just completed a job which required 200GB of retouched psd! HD space these days is measured in 1000's of GBs, so i don't think saving a little bit here and there is worthy of a request. 
I'd be much more interested in them coming up with a format which allows for saving only the changes to a given file... so that when i have a 10GB psb, but all i've done is added an adjustment  layer, only that is needing to be saved, instead of the entire 10GB.
Photo of James Gray

James Gray

  • 36 Posts
  • 12 Reply Likes
Champion, It seems to me that you have really hit the nail on the head.  Because jpegs are encoded with a discrete cosine transformation they are not internally compatible with the way that data is stored in a psd file.  Unless the adjustments are saved the way that they are in Lightroom as .xmp files or the equivalent it looks to me like programming transformation nightmare to implement a way to accomplish what Jim A is requesting.  Like you say if it was easy it would have already been done.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
There's no such thing as saving layered files out as the original jpgs.
I don't follow you. Microsoft Word can embed JPEGs. InDesign uses linked JPEGs. Why not Photoshop?
What's the actual complaint/request? You're only interested in saving HD space?
Yes, it's purely about space. Sure, a lot of Photoshop documents have layers containing unique raster data, which needs to be saved. However, most of the time my Photoshop documents don't contain unique raster data, they only contain JPEGs that have been duplicated, flipped, etc, with adjustment layers. There's no reason why the Photoshop file needs to be much larger than the JPEGs it contains.
If you're doing this professionally, then it's a requirement of the job to have an abundance of available disk space ... i don't think saving a little bit here and there is worthy of a request.
You might not care, but a lot of people appreciate the importance of making files as small as they can be, for maximum efficiency. It's means:
  1. Faster online transferring of files
  2. Faster backing up (especially to the cloud)
  3. Drives fill up less quickly
  4. Less need to add/replace drives in your computer
  5. Less money spent on storage (and backup)
I have approximately 27 terabytes of hard drive space on my system, and plenty of room. But I am always interested in saving space. If I could free up hundreds of gigs by reducing the size of my Photoshop files, I would be interested.

Google has a vast amount of storage space, but if you offered them a way to make all their files a tenth of the size, they would bite your hand off.
Photo of Michel BRETECHER

Michel BRETECHER, Champion

  • 1276 Posts
  • 270 Reply Likes
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.
This is never a problem for me. If I only need simple adjustment layers, I can do much more parametric editing in Lightroom or ACR as already explained.
(Note: I am using Elements and nearly always use the 'Open in ACR' command for jpegs as well as for raws. Less than 5% of my edits need going to the pixel editor.)

I edit the jpegs in ACR (much faster to edit by batches), select all my edited batch and click 'Done'. All the edits are saved in the metadata header of the jpegs. The thumbnails in the organizer are updated, the catalog also. No creation of new "-edited" resulting files. No new jpeg compression from the orignal, which is still available. The editing 'recipe' is saved and available to apply to new files. Next time the file is opened (either from the editor or the organizer) it opens in ACR and it's easy to compare original and final versions.
Do I need a 'cooked' final version? I click 'Open' and from the editor, I can save in a version set at optimal compression for jpeg. Or, I export from the organizer (by batch) with my output-preferred file formats and parameters. I rarely need to store exported versions since I can reproduce them at will.

So, even if I decide to create a final "cooked" version in a version set, it won't weigh more than the original 4Mb.

This is my answer to the question about edits only by adjustment layers, but what about pictures which need the pixel editor? The initial edit from ACR needs further edits with layers and possibly many smart layers (think about scrapbooking or book pages). The real question now is 'do I need to keep everything, or only a final jpeg/psd/tiff version? I generally only need that for a given period. It's important to 'simplify' the smart layers to avoid gigantic psd/tiff files. Periodically, I review my big projects and I 'flatten' the layers and save as a jpeg. In the organizer I can 'flatten' the version set which keeps only the final version and deletes the intermediate versions.



Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
This is never a problem for me. If I only need simple adjustment layers, I can do much more parametric editing in Lightroom
Not everyone wants to use Lightroom, or has a workflow suited to it. I've been using Photoshop since 1994, long before Lightroom came along. I personally would not want to use a program which denied me the full range of Photoshop abilities, but each to their own.

The "parametric" editing (good word) offered by Lightroom and ACR does sound great. So why not allow it in Photoshop? It's certainly not "beyond the scope" of Photoshop, it simply means files are smaller. That should never be beyond the scope of any program.
Photo of Michel BRETECHER

Michel BRETECHER, Champion

  • 1276 Posts
  • 270 Reply Likes
Re-read my post. I don't use Lightroom, I am using Elements together with its organizer and ACR for my own needs. Contrary to 'pro' users, I don't only work on millions of shots like events and sports reporters. I don't only work on retouching jobs implying hundreds of layers and a multitude of detailed retouches. It's everything when I need to. For those pros, it's easy to tell which tool, parametric or pixel editor is the best. Pixel editors are needed for both photographes and digital painters. Digital painters also need vector tools like Illustrator.
This forum is full of people wanting a single app to be at the same time a pixel, a parametric and a vector editor. All that 'smartly integrated'. And of course, smarly integrated with FB, Google and all social media on the 'cloud'!

I don't believe in 'smart' integration. Better is possible but difficult, especially when the dedicated tools have been developped separately, which is the case with Adobe. The result is a package which requires good understanding from the users and a huge learning effort. Then, the best workflow and choice of tools will be more obvious depending on your type of job.  And I am glad you found my advice about parametric edinting a possible solution to the big waste in diskspace in your original example.

Difficult to advise a given workflow to avoid such waste if you don't know if you are mostlly a retoucher or a wedding photog, if you need very detailed saving of your job for a limited time or forever. In my case, edits needing hours are the exception. Such edits don't need to be kept more than one year, except for a few tutorials. It seems that other champions have understood your challenge as optimizing the size of multilayered files with a lot of 'smart objects'. That's another topic, and my question is: if it's so important to keep the information about each editing detail from all the external sources in a pixel workflow, why bother about disk space? Will all those details be useful in a few years?
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
This forum is full of people wanting a single app to be at the same time a pixel, a parametric and a vector editor. All that 'smartly integrated'. And of course, smarly integrated with FB, Google and all social media on the 'cloud'!
Well I haven't mentioned any of those other things. (I hate applications connecting to the internet, and the only thing my firewall allows to connect is my web browser.)

As for there being some kind of incompatibility between pixel and parametric editing - there's no incompatibility. It just means you want to be able to work with images without destroying them. Photoshop has offered this for years in the form of Smart Objects.
Photo of Michel BRETECHER

Michel BRETECHER, Champion

  • 1276 Posts
  • 270 Reply Likes
You wrote:
"The "parametric" editing (good word) offered by Lightroom and ACR does sound great. So why not allow it in Photoshop? It's certainly not "beyond the scope" of Photoshop, it simply means files are smaller. 
Which proves my point that there is no incompatibility between Photoshop and ACR or Lightroom or Elements with ACR.  It's up to you to be the 'smart' user of the tools at your disposal. I think most LR users are happy to edit 90% of their files in LR and  100% with additional work in PS. Same for me in PSE plus ACR.
The simple fact that editing jpegs 'parametrically' does not create a new version and only adds a tiny amount to the unchanged original pixels offers the best solution to save disk space. The editing is non destructive. The original is available. The virtual version does not need to be in jpeg to avoid compression losses.
Imagine I have to create a composite 12" x 12" page from a dozen of 4000 x 6000 pixels jpegs from a camera. Those assets have been edited parametrically. Since I am working in Elements, when I drag them from the photobin to my canvas, they appear as smart layers. (embedded with parameters, no linking in PSE).  Most of the time, I can resize, move rotate those assets at will and add adjustment layers to each one. The resulting composite tiff/psd keeps the ability to re-edit everything from scratch without wasting diskspace.  If I only want to allow small ulterior changes (text, a few image replacements), I 'flatten' (rasterize) the smart layers, and the file size shrinks significantly. If the next year I don't see any reason to re-edit, I flatten and save as high quality jpeg.  
(Edited)
Photo of Steve Lehman

Steve Lehman

  • 851 Posts
  • 96 Reply Likes
Hey JIM A.  
"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."  

JIM,
I cannot see how a JPEG would be 4 megs.  I can see how it would grow to a larger file, but a JPEG file is NEVER that large.  It's usually around 4Kb not megs

So really - there's no reason to embed JPEG's because they don't take up a lot of file size.  I don't see a problem with JPEG file sizes.  NO JIM, I don't agree with you on this one.  No embedding needed.  ta ta gotta go.  I am a busy guy 
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
I cannot see how a JPEG would be 4 megs.  I can see how it would grow to a larger file, but a JPEG file is NEVER that large.  It's usually around 4Kb not megs

You must be mistaken. Maybe some web designers work with 4Kb JPEGs, but high-quality online JPEGs are usually a couple of megs, and the original JPEGs from cameras are typically around 4–8 megs.
Photo of James Gray

James Gray

  • 36 Posts
  • 12 Reply Likes
Agree.  I have jpegs that are as much as 37 mb.
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
C'mon y'all, let's be helpful here. If the OP had specified multi-layer smart object compositing from the start, it would have been helpful, and now it sounds more like a different ask... let's see if I can abstract this a bit more...

Basic request sounds like... remove rasterized layer data from smart-object layers on save.

This would have two prominent effects, IMO...
Pro: Smaller file size and faster saves, depending on how many duplicate instances of smart objects you have
Con: Longer delays on file-open because each smart object instance layer has to rebuild the rasterized layer

Which could have a lot of merit and might (I stress might) be relatively simple to implement.
Photo of eartho

eartho, Champion

  • 1229 Posts
  • 378 Reply Likes
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?
Photo of Steve Lehman

Steve Lehman

  • 851 Posts
  • 97 Reply Likes
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.  
 
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
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.

Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
Thank you Mr Johnson for understanding me and not being as dismissive as the others here. If you think my idea could be worthy of Adobe looking into it then perhaps you could vote for my idea (which no one seems to have done yet).
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?
Eartho, you have misunderstood me. This idea has nothing to do with saving as a JPEG. It's about embedding JPEGs into Photoshop documents. (And for the record, you referred to me as a "they". I'm a he! How many women do you know called Jim?)
Photo of David Converse

David Converse

  • 790 Posts
  • 230 Reply Likes
Why aren't you saving back out as JPEG? I'm not seeing how there is a problem here.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
If I saved as a JPEG, I'd never be able to edit document again! Most designers retain their psd files so they can make future changes.
Photo of David Converse

David Converse

  • 790 Posts
  • 230 Reply Likes
What you want isn't possible. You either have a lossy compressed format or you retain all the editing data and layers and have a large file.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
But if all your layers are just copies of a 1 meg JPEG file, why should any pixel data be saved other than the 1 meg JPEG file?
Photo of David Converse

David Converse

  • 790 Posts
  • 230 Reply Likes
Because its not a 1 meg JPEG file. Compressed and uncompressed are two different things. You just said that you don't want lossy compression.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
I feel like you're misunderstanding what I'm asking for.

I am a designer and I work in Photoshop. I don't want to lose my Photoshop documents, nor would I ever save a Photoshop document as a JPEG because that would destroy all the layer data, make it lossy, and uneditable.

What I'm trying to do is bring JPEGs into a Photoshop document and retain them as JPEGs instead of converting them to raster data.

Now with the help of another user here (Max Johnson) I have found out that Photoshop already allows you to do what I want and embed JPEGs (just go to File > Place Embedded and import the JPEG that was). The problem is that these files are STILL being saved as raster data, making the document far bigger than it needs to be.
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
OK, I had time to do an A:B:C test and here's some solid numbers.

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.

A) Saved as-is.
B) Saved with a solid color overlay fx of white applied to each layer (to see if that changed the rasterized save data to be smaller)
C) Saved over the jpeg inside the smart object with solid white (simulating a near total clearing out of image data from the main document's layers)

A: 125mb
B: 97mb
C: 5.51mb

So there is a clear and substantial difference in file size when the rasterized layer data is "removed".

I can't speak to how speedy the file would load if you have to re-raster all the layers but it might be worth the trade-off for people who have to do all their work from a contractor laptop with a single ssd.

Photo of James Gray

James Gray

  • 36 Posts
  • 11 Reply Likes
nice test.  Thanks.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
Hmmm, that's an interesting test. Though I'm not sure what it proves, and I don't see the point of using a JPEG for the test? If you open a JPEG in Photoshop and make it into a smart object, Photoshop doesn't know the data originates from a JPEG and doesn't retain any of the compression information?
Photo of James Gray

James Gray

  • 36 Posts
  • 11 Reply Likes
To the best of my knowledge when you open a jpeg in Photoshop it does not retain the compression in any way.  If you resave the image as a jpeg it recreates the compression and it will be different than the previous jpeg and will generally result in more information being lost in the compression. 
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
@Jim, mechanically, there are three different ways (well 4, but with CC libs) to embed an image that originates from a JPEG. Bear with me, I'm not trying to be condescending here...

1. You add the jpeg image as a new layer that is not a smart layer... it's just pixels, then you convert that layer to an embedded smart object
2. You "place" the jpeg directly as a smart object layer either through drag-n-drop (if you have that setting enabled, or through "File->Place Embedded..."
3. You place a jpeg as a linked object then convert to embedded.

In case #1, your smart object is a new .psb file embedded in the document.
In case #2/3, it literally copies the jpeg file and saves it into the document like a secret zip file. If you open the smart object, the title of the new tab has a name like "whateverthing.jpg"

Same if you embed a bitmap or a png directly. So from a purely technical semantic point of view, Photoshop already does exactly what you originally asked for... it's just that it wasn't necessarily the root of the problem you are trying to solve.

Here's a test for you... in your doc, select a smart object layer and do "Layer->Smart Objects-> Export Contents..." and save out the contents. Then you can check the file size of that to see how much room it's taking in your psd. Also whether it's a jpg or psb file.
(Edited)
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
Very well explained, sir!
it literally copies the jpeg file and saves it into the document like a secret zip file. If you open the smart object, the title of the new tab has a name like "whateverthing.jpg"
Wow, I did not realize this. Because of how big the psd files are, I was assuming that any JPEG compression had been discarded and turned to raster data.

So you're right: Photoshop is already doing what I want it to do. It's already embedding JPEGs! That's half the battle. The only problem remaining, then, is the way that files are saved.

I don't suppose you know of any way I can "retire" this idea, or mark it solved, allowing me to create a new idea that's more specific to the problem?
(Edited)
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
For the record, I've done a similar test myself and here are my results:

1. Completely empty Photoshop document with a white background (3000x3000 in size)
= 650k

2. Same document containing a 836k JPEG embedded as a smart object, shrunk down in the document to a tiny size
= 1.8 meg

3. Same document with the JPEG smart object now filling the entire document
= 25 megs

4. Same document with the single JPEG smart object copied several times, flipped, warped, distorted etc.
= 31 megs

5. Same document with all the layers set to invisible
= 23 megs

6. Same document, but with the full-size JPEG moved to the very top - meaning it looks identical to document (3) above
= 34 megs

7. Same document, but with the embedded JPEG blanked to white, meaning all the copies are white
= 3.1 megs

Conclusions:

• Embedded JPEG smart objects really are retained as JPEGs, meaning no space is wasted on the smart object itself.
= Efficient storage

• However, every single instance of the smart object in the document is saved as (compressed) raster data. Even instances that are hidden or turned off - they're still being saved as (compressed) raster data which adds to the filesize.
= Inefficient storage

I see no need for this. All Photoshop should reuiqre is the original JPEG, information about where each instance is positioned, and a single preview image, which should be of limited resolution. I'd be quite happy for all my preview images to be limited to 1920x1080 and use maximum quality JPEG compression.
Photo of Steve Lehman

Steve Lehman

  • 851 Posts
  • 96 Reply Likes
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



Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
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.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
Mr Lehman,

The title of this idea is: "Allow JPEGs to be embedded, to save disk space". It has nothing to do with speed. I suppose everyone's different but I don't mind my files opening and closing a little slower if it means the files are many times smaller.

I do have a gripe that newer versions of Photoshop take many times longer to launch than older versions, but it's unrelated to this issue.
(Edited)
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
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.
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
Right, the online aspect is what I was thinking of too. Sharing files and backing up. There are currently huge efforts being made to improve compression for online files (video compression etc) in order to minimize data. As an efficient person, I always like things to be as optimized as possible to save file space.
Photo of Steve Lehman

Steve Lehman

  • 851 Posts
  • 96 Reply Likes
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.   
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
"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.
Photo of eartho

eartho, Champion

  • 1231 Posts
  • 379 Reply Likes
Max, this is why we have linked smart objects and we can work around file save sizes by saving without the preview.
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
@eartho, I did my test again, converting to a linked instead of embedded object and the difference in file size was literally only the size of the original jpeg. Which makes sense.
Saving w/out preview only saved a few Kb... because I suspect that only is a single small preview image of the whole document for OS and bridge to display...

Good idea, but there was no significant file savings there, sorry. :(
Photo of Todd Shaner

Todd Shaner, Champion

  • 1600 Posts
  • 539 Reply Likes
TIFF file format has a JPEG compression mode. Not sure if that's of any benefit, but you can try it.

Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
this is why we have linked smart objects
Using linked smart objects is a little cumbersome. First you have to first measure the size of the JPEG, then create a new document the same size, then finally "Place" the JPEG into the document as a linked smart object.

I've just tried doing this and it makes no difference to the final file size. It's obviously still being turned into raster data.

But the idea of using linked smart objects is probably the way to go. All Adobe needs to do is:
  1. Make all JPEGs open as linked Smart Objects by default, rather than having to create a "container" document and "Paste" them in.
  2. Don't save copies of the JPEGs inside the document!
  3. Preview files should be of limited resolution, JPEG compressed
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
TIFF file format has a JPEG compression mode. Not sure if that's of any benefit, but you can try it.
Thanks, but that isn't helpful. This would re-compress the images and make them lossy.
Photo of Max Johnson

Max Johnson, Champion

  • 597 Posts
  • 314 Reply Likes
Linked objects have their own set of issues, like causing havoc with deliveries when you or a vendor forgets to send those linked files... and in the case of a jpeg or 2, you are not saving any total file size if you are embedding the jpeg directly by placing it as an embedded object. The data has to live somewhere, it's just whether the original is zipped up in the psd or linked from outside... there's still only one copy.
Using linked smart objects is a little cumbersome. First you have to first measure the size of the JPEG, then create a new document the same size, then finally "Place" the JPEG into the document...
That I can help with! Here's a three step workflow to get you there...
1. Create new document preset with 100x100px (+ any other settings you usually have), now you can use that over and over.
2. Place your jpeg directly as an embedded smart object (see optional step 2a for faster way to do this)
  2a . Optionally, change options->General->"Always create smart objects when placing..." so you can just drag-n-drop from your file system onto the canvas.
3. Image->Reveal All
Photo of Jim Ainsley

Jim Ainsley

  • 45 Posts
  • 18 Reply Likes
Thanks, Mr Johnson :)

It's still cumbersome but better than having to measure the JPEG first. Oh and you also need to make sure you have this preference disabled: "Resize image during place" (I assume most of us have it turned off as it's really annoying LOL)
Photo of Steve Lehman

Steve Lehman

  • 851 Posts
  • 96 Reply Likes
What if Adobe made a new JPEG in 16 bit (for camera files) that auto-converted to 8 bit JPEG (uncompressed) for printing and embedded files this way you would still have a compressed 16 bit in the camera and a "lossless" 8 bit JPEG ("TIFF").  I think this would be the same as a TIFF that converts to a JPEG which nobody liked.  Don't beat me up, it's only a suggestion.