Jump to content
You must now use your email address to sign in [click for more info] ×

Save (flattened) increases original file size drastically


Recommended Posts

I'm trying to find a quick and efficient way to save modified .jpg photos by overwriting the original file. I understand that the save command does that but the file size increases to 3-4 times the original size every time I do that. I haven't got 'save with history' turned on so why this unreasonable increase in file size? Is there a way to overwrite the original file by pressing a single shortcut without ending up with an unreasonably large file?

Link to comment
Share on other sites

To use export:

1. I press shortcut to bring up export settings,

2. set the quality,

3. click more,

4. set parameters there,

5. click close,

6. click export,

7. click save,

8. confirm overwriting

 

= 8 steps... (!)

 

To use the save command takes a single shortcut.

Makes a whole world of difference when you've got hundreds of photos to edit and typically spend no more than 1 minute with a photo...

 

That is why I asked for a way to do this "by pressing a single shortcut"

Link to comment
Share on other sites

1. Save with history, snapshots, & any other Affinity feature not supported by the JPEG format won't matter if you save the file as a JPEG, however you save it to that format. JPEGs will always be flattened into a single pixel layer because that is all the format can support.

 

2. If the original JPEG includes no color profile, opening it in Affinity will assign whatever profile is set as the default in Preferences > Color Profiles for file's color space. This will add to the file's size when saved back to a flattened JPEG. The added size will vary depending on the size of the color profile, but typically it is not more than a hundred KB or so.

 

3. JPEG uses lossy compression to reduce image file size. It is less effective on images with lots of fine detail (like complex textures, sharp edge transitions, etc.) so if your edits add more detail than was present in the the original, file size will increase, sometimes substantially. Without resorting to exporting to JPEG format, you can reduce file size when saving flattened by eliminating unimportant details, often enough that the file will be smaller than the original.

 

For example, a photo that includes a lot of clear blue sky might actually have hundreds of slightly different shades of blue in different areas of the sky. Painting over them with a brush set to a blue shade that is the average of the blues in that area will make the compression much more effective. Using a denoise filter can also be very effective for this.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

JPEG file size depends mostly on JPEG compression setting (quality setting). "Save" saves JPEG at 100 % quality. That is the default. It may be six times bigger than 50 % quality, depending the image content.

 

At the moment it seems there is no way to adjust that default to suit one shortcut save. Possibly in the new version "sticky settings" feature will remember the last used JPEG quality setting so you could use single shortcut save like you described.

Link to comment
Share on other sites

JPEG file size depends mostly on JPEG compression setting (quality setting).

It is also strongly dependent on the amount of detail in the image. Lossy JPEG compression works by removing high frequency content -- basically sharp changes in luminosity & color. So if a JPEG is opened in Affinity (or any other graphics app) & edited such that the high frequency content is significantly increased, saving the file at the same quality setting as the original will result in a substantially larger file.

 

But since there is no way to know the quality setting used when the JPEG file was saved originally, there is no way for the app to know in advance what quality setting will preserve an acceptable amount of detail in the edited version. Affinity plays it safe by defaulting to the 100% quality setting, which I believe is the correct thing to do.

 

If minimal file size with acceptable quality is the goal, then reducing the high frequency content is just as if not more important than the quality setting used when the file is saved. Since this will vary greatly depending on the image content & how editing changes it, no one default setting applied to all images can possibly do that. It has to be done image by image.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff

Ironically, iterate saves back over a JPEG with heavy compression can actually add "detail" through the compression artefacts.  The artefacts will be present after each reload, and will be re-compressed.  The result will be a worsening image quality and a potential increase in relative file size.

 

JPEG should not be used as a working file format.  You are best advised to import an original image, work in an afphoto file, then export back to JPEG when you have completed you work.

 

Even though we allow saving directly back to JPEG for convenience and compatibility with DAM workflow (for anyone who doesn't care about lossy compression), it's always going to come at a cost.

SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB
Link to comment
Share on other sites

Even though we allow saving directly back to JPEG for convenience and compatibility with DAM workflow (for anyone who doesn't care about lossy compression), it's always going to come at a cost.

So does this mean that doing this will always use the 100% quality setting, the same as the JPEG "Best Quality" export preset? Since that applies the lightest compression, it seems like the best choice.

 

Also, what if any type of resampling does doing this use? Bilinear like the export preset, or something else? 

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff

So does this mean that doing this will always use the 100% quality setting, the same as the JPEG "Best Quality" export preset? Since that applies the lightest compression, it seems like the best choice.

 

Also, what if any type of resampling does doing this use? Bilinear like the export preset, or something else? 

 

A JPEG re-save won't resample as it should be saving back a 1:1 image.  Any changes that make the document more complex (such as added layers or transparency) should force you to chose whether to flatten and save or save to an AF file.

 

As far as quality goes - if the JPEG includes the compression information supplied by Adobe, we will try to continue using that compression amount.  We do have to munge the numbers a little as the Adobe compression power is a value from -3 to 8 (I know, weird). We use a value from 0 to 100.  Also, we probably use entirely different compression code to Photoshop, so results will be different.  If we automatically went with "Best Quality", the file size is likely to jump considerably.  It's tricky to know what the best path is here.  Everyone will have contrary requirements.

 

I've not done enough testing to see how different the results are between Affinity and Photoshop to see how our compression values affect the output.  Maybe something to do when I have a couple of spare days.

SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB
Link to comment
Share on other sites

Ben, thanks for the info. I wasn't even aware that Adobe-created JPEGs could include compression info. Most of my JPEGs came from various sources, & do not seem to include that, but I can't be sure about it. So if that info is not included in the file, what does Affinity do on a re-save?

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff

Yes - Adobe have a "special" image resource block just for describing JPEG settings (described as "JPEG quality. Private." in the PSD spec - so helpful) which mirrors the settings in Photoshop.  It's undocumented, but simple enough to decode.  It is specific to their encoder, so we have to reinterpret it for ours.

 

If it is missing, we would just use the default settings, which should be 100% quality.

SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB
Link to comment
Share on other sites

If it is missing, we would just use the default settings, which should be 100% quality.

Good to know.  :)

 

Personally, I would prefer that it would always use 100% quality & ignore the PSD JPEG quality resource (because an edit I might do to the JPEG file in Affinity that increased detail might not be preserved at a lower original quality setting). But it is really a non-issue for me because if I edit a preexisting JPEG I almost never re-save it as a JPEG. I either save it in the native Affinity format or export it to PNG or some other lossless format. If I want a JPEG version, I will export it, giving me control over quality, metadata, etc.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • Staff

That's what I'd hope any sensible workflow would look like.

 

Save-back is for the people who complained that you have to export to save a JPEG.  Personally, I would never do that either.  Regardless of my source, I'd keep all my work in the native application format until I need to bake and compress.

 

Grudgingly, I also added the ability to save-back to PSD.  It may be lossless in terms of pixel data, but it is still a destructive conversion from our native format.

 

Stick with AF files!!!!

SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB
Link to comment
Share on other sites

I do understand that a healthy workflow is to save and keep the edited file at the highest possible quality and save a lower quality version when needed. I do the same thing when doing creative work on an image with lot's of edits.

 

However it's a completely different case with everyday photos that only need quick improving before archiving. There's hundreds of them and I won't ever want to come back to them later to change adjustments settings. Undistructive editing is not an issue here - efficient and quick workflow is. A 10Mp photo is 3-4MB size as it comes from the camera. In most cases all I need is quick tonal adjustments, sharpen and save back without losing quality. I do understand that sharpen for example can increase file size. But ending up with 10-15MB size photos is definitely not justified in this case... has no advantages at all but disadvantages.

 

When doing creative work on an image for hours it only takes a single shortcut to save at the desired quality (AF file) - which is nice. When only doing a few quick improvements that take less than a minute it takes three steps or more to save at the desired quality - :( ... It would be very nice to be able to set the default save quality.

Link to comment
Share on other sites

A 10Mp photo is 3-4MB size as it comes from the camera. In most cases all I need is quick tonal adjustments, sharpen and save back without losing quality.

But if, among other things, you sharpen the image you could lose quality if you re-save it without adjusting the quality setting accordingly. Plus, since JPEG compression is lossy, you can never get back the detail lost during compression if you overwrite the original.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

 

But if, among other things, you sharpen the image you could lose quality if you re-save it without adjusting the quality setting accordingly.

I do adjust it accordingly when using export. I set jpg quality to 95% and get a ~4MB image. I just wish I didn't have to do it every single time again...

 

 

The second time it's 3 clicks as it remembers previous settings

I use export now and unfortunately it does not remember my quality setting... (I also thought it does - I seem to remember so - but it doesn't now) Also, because of exporting instead of saving it will ask me whether I want to save - every time I close the image. That's +1 step. As it is now I use export and it takes 6 steps to have my file overwriten with the quality setting I want.

Link to comment
Share on other sites

If you sharpen an image you increase its high frequency content -- you get sharper color & luminance transitions, right? And that will vary depending on the amount of sharpening you apply & the detail of each image, right? So how would you determine a default quality setting for re-saving that could avoid (destructively!) adding visible artifacts that might make the image look considerably worse than the original?

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

The amount of sharpening I need to correct a photo does not vary widely, it's often the same. I'm an end user, an artist and a practical person, not a developer nor a philosopher. What I do is compare the edited and saved result with the original or with the idea I had in mind. Display it 1:1 on the screen or study a printed copy of the result. If I find no fault with it then I'm satisfied and do not think much about what compression is doing to my pixels. I find that a default quality setting works well with this kind of work. What I may lose using 95% jpg instead of 100% is something nobody will ever notice at my place unlike what I lose by having thousands of 15MB photos instead of 4MB ones...

Link to comment
Share on other sites

I do not understand how you can compare the edited version while it is open in Affinity to the JPEG file on your drive. While the document is open, no compression is applied -- that only happens when you re-save the file, overwriting the original. Plus, as I have mentioned more than once, the change in high frequency information added to the edited version will depend on the image content as well as the amount of sharpening applied.

 

This is why I have suggested it is best to save the file in native format or to a lossless format like PNG instead of overwriting the original. You won't know what the re-saved file looks like until you open it afterwards, so if you have overwritten the original there is nothing to compare it to.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

If you want to compare you can save a copy...

 

There is no need to emphasize meaning of high frequency content as its variance and thus impact to file size is not so much with normal photos.

 

If AP would support export in macros it would be possible to line up the standard commands and have a one key work flow. That is what I used to do in PS (nowadays I let LinkOptimizer do that).

Link to comment
Share on other sites

There is no need to emphasize meaning of high frequency content as its variance and thus impact to file size is not so much with normal photos.

There is considerable variance in the high frequency content of "normal" photos. Consider for instance the difference between a brightly lit shot taken with the lens stopped down vs. one taken in low light with the lens nearly wide open. With the lens stopped down, much more of the background will be in sharp focus, so if say it contains sunlit, leafy foliage or anything else with a lot of texture it will have a lot more high frequency content than a shot with the background in soft focus.

 

I have dozens of shots taken with a Nikon point & shoot camera that always uses the same JPEG compression level. The range of file sizes is at least 4 to 1, which depends strongly on the content & shooting conditions.

All 3 1.10.8, & all 3 V2.4.1 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.