Jump to content
canetti2

Very bad JPEG compression with Affinity Photo

Recommended Posts

Hello,

 

until now we worked with the old Adobe Photoshop CS2 version. Our first impression of Affinity Photo was very positive - we was excited!!!

Unfortunately the program seems not really optimised for webworking because the compression (export) of JPEG files is shocking! With Photoshop CS2 we can reduce the JPEGs for more than 50% and the quality of the pictures is also much better.

 

Therefore I am interested if the problem is known and if we can hope for a soon bug fix? With the current version we must reduce the generated JPEGs with a second tool. This is not really a good solution...

 

I look forward to your response.

 

Best regards

canetti

Share this post


Link to post
Share on other sites

in my experience (comparing to a lot of open source jpeg libraries, irfanview, mozjpeg 2  / mozjpeg 3) Photoshop's jpeg export is actually shockingly good and you should not expect any other program to just blindly match it :). That's with CC 2014 / 2015 / 2017 though, but I doubt the jpeg engine changed over the years.

 

Mozjpeg3 is still the winner of them all, but I never use irfanview or imagemagick's jpeg save anymore because photoshop's is clearly better.

 

If it's possible for the Affinity team to incorporate the opensource mozjpeg3 library (a mod /fork of the 'normal' libjpeg as far as I know) it would be a winner :P, but I have no clue if this is possible license-wise and all.

Share this post


Link to post
Share on other sites

Have you tried the different resample options in the Export dialog? Depending on the type of image, one or another of them can make a big difference in the quality of a highly compressed jpeg.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

Hi canetti2,

Welcome to Affinity Forums  :)

We are continually improving our import/export formats and will eventually improve this over time. We also still have to add previews to the Export Persona, so i believe image optimisation (for web) will be addressed at some point. If you could/attach some images (original and exports from Photoshop/Affinity) as examples i will add them to out log for testing/reference.

Thanks for your feedback.

 

 

 

Have you tried the different resample options in the Export dialog? Depending on the type of image, one or another of them can make a big difference in the quality of a highly compressed jpeg.

@R C-R,

The resample options only matter when resizing (scaling images) images. Exporting an image (compressing) to JPG doesn't imply scaling them. Those are different things.

The OP is referring to JPG optimisation for web.

Share this post


Link to post
Share on other sites

@R C-R,

The resample options only matter when resizing (scaling images) images. Exporting an image (compressing) to JPG doesn't imply scaling them. Those are different things.

Then why are there resample options in the JPEG export dialogs? I did some experimentation exporting at a constant original image size & extreme compression (Quality =10) using Nearest Neighbor & Lanczos settings. Depending on the document's contents the differences may be small but they are not zero.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

Hi to all of you,

 

at first many thanks for your quick responses. Please look at this images - I know the original quality is not good, but anyway....

 

https://www.dropbox.com/sh/ms9ijavr0iqh7s9/AAAiMGbnY2ylu1zh0XCwRqPua?dl=0

 

Original picture > 2 MB

Affinity Photo compression, quality 5% : 104 kb

Adobe Photoshop CS2 compression, quality 19% : 100 kb

 

And yes, I tried with all different Affintiy jpeg compression options - the result is always much worse than Photoshop

 

A pity but for us this is a no go to replace our old Photosho CS2 ;-(

 

I hope you can optimise the jpeg compression soon....

 

Best regards

canetti

Share this post


Link to post
Share on other sites

canetti2,

 

You may find the comments about Photoshop CS2 compression here of interest, particularly in the Chroma Subsampling & the Photoshop CS2 Quality vs File Size sections.

 

If you are using CS2's "Save for Web" option, this article by the same author may also be of interest. Note in particular the comments about metadata marker removal & the ~40KB difference this can make.

 

With all that in mind, I am curious how you decided on the compression quality settings for each app (& what "quality 19%" means in PS's normal 'goes to 12' compression scale).

 

EDIT: While we are on the subject of JPEG compression, this old article about optimizing JPEGs in Photoshop CS2 may be of interest as well. The principles are the same for any app -- softer edges, lower saturation & lower contrast images compress better than sharper ones.

Edited by R C-R

Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

EDIT: While we are on the subject of JPEG compression, this old article about optimizing JPEGs in Photoshop CS2 may be of interest as well. The principles are the same for any app -- softer edges, lower saturation & lower contrast images compress better than sharper ones.

 

Thanks for the link. I knew about sharp edges in relation to JPEG quality, but I wasn't aware of their effect on compression efficiency.


Alfred online2long.gif
Affinity Designer/Photo/Publisher 1.7.3.481 • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.7.3.155 • Designer for iPad 1.7.3.1 • iPadOS 13.3 (iPad Air 2)

Share this post


Link to post
Share on other sites

R C-R,

 

many thanks for the links. But the technical details of compression do not interest me. I want only create a jpg picture with a small file size as possbible in an acceptable quality. And in this requirement the old Photoshop CS2 does much better work than the brand new Affinity Photo - isn't it?

 

screen.gif

Share this post


Link to post
Share on other sites

canetti2,

 

In none of the documentation for CS2 I can find does it say the quality value is a percent, just a number ranging from 1 to 12, & there is no "%" symbol shown in your screenshot. Does your documentation say that it is a percent value?


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

Save as in PS gives 0–12, save for web has 0–100.

 

Here is a quick quality comparison, PS quality 2 (100) first, Affinity quality 10 (100) below it. Had to go low in PS to get same file size 38,5 KB.

 

_DSC1419-ps2.jpg?dl=0

 

_DSC1419-aff10.jpg?dl=0

 

And 100 % quality from PS to compare to "original":

 

_DSC1419-ps100.jpg?dl=0

Share this post


Link to post
Share on other sites

Then why are there resample options in the JPEG export dialogs? I did some experimentation exporting at a constant original image size & extreme compression (Quality =10) using Nearest Neighbor & Lanczos settings. Depending on the document's contents the differences may be small but they are not zero.

They are there because you may want to resize the image and in that case the Resample algorithm does matter.

When you are simply exporting an image without resizing the resampling method is irrelevant (assuming you are not working with a composition where layers where scaled down). This doesn't depend on the image. If you are not resizing the images there's no differences in the results no matter the resample method you pick

 

The pre-optimisations you are suggesting are not important because for a fair comparison you have to perform them to the same image on both programs which leads to similar image data before exporting. With the same image data Photoshop will eventually get a superior result again due to a better export/compression engine.

 

The results posted by canetti2 show that for an approximate file size of 100Kb the visual quality of the image exported by Photoshop is still superior to the one exported by Affinity no matter the mismatch between the scales (except for Save for Web where both go up to 100) assuming both are using the same settings.

 

 

 

Hi to all of you,

 

at first many thanks for your quick responses. Please look at this images - I know the original quality is not good, but anyway....

 

https://www.dropbox.com/sh/ms9ijavr0iqh7s9/AAAiMGbnY2ylu1zh0XCwRqPua?dl=0

 

Original picture > 2 MB

Affinity Photo compression, quality 5% : 104 kb

Adobe Photoshop CS2 compression, quality 19% : 100 kb

 

And yes, I tried with all different Affintiy jpeg compression options - the result is always much worse than Photoshop

 

A pity but for us this is a no go to replace our old Photosho CS2 ;-(

 

I hope you can optimise the jpeg compression soon....

 

Best regards

canetti

Thanks for the files. I will add them to our log.

Share this post


Link to post
Share on other sites

Comparisons need to be done at (roughly) the same filesize. Like the OP, he tweaked the values so that they both give or take got the same filesizes (104kb and 100kb apparently). If the 100kb is clearly better looking then there is quality difference :P.

 

About the resample options in the export dialog (they are there for all filetypes, not just jpeg):

 

Isn't it also the case that you can have documents scaled to (for example) 4523.8 by 793.3 pixels in Affinity. And if you export, those boundaries need to be rounded to the nearest full pixel, thus you get a fractional resize (and thus the option to choose your resampler).

 

It could also be the case if for a format (like jpeg) it's possible to do chroma subsampling, and the resampler is used to downsample the chroma. Although this would be weird as 'too sharp' for chroma downsampling really gives artifacts, and lanczos (both options) is really not the best for chroma downsampling as I read it. So the option shouldn't be there in that case.

 

But I believe it's there to do on-the-fly scaling if you wish, and to round-to-nearest-pixel if you got fractions in your dimensions. Otherwise a resampler would really be a silly option for exporting to tiff or exr :).

 

I'm so used to using the mozjpeg command line together with ImageMagick that the quality of built-in jpeg export is non-issue for me, but clearly for a lot of people this can be a make-or-break it kinda situation.

Share this post


Link to post
Share on other sites

If I copy the "100% quality" example that Fixx provided and paste it into Serif PhotoPlus or DrawPlus, exporting at 10% quality gives me a result like the Affinity 10% quality example, but the file size is less than 27 KB. If I increase the quality setting to 19% for a file size of 38 KB, the result is like the PS 'Save for Web' (2% quality) example; I get the same file size and quality from the 2% setting in PS Elements.


Alfred online2long.gif
Affinity Designer/Photo/Publisher 1.7.3.481 • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.7.3.155 • Designer for iPad 1.7.3.1 • iPadOS 13.3 (iPad Air 2)

Share this post


Link to post
Share on other sites

Isn't it also the case that you can have documents scaled to (for example) 4523.8 by 793.3 pixels in Affinity. And if you export, those boundaries need to be rounded to the nearest full pixel, thus you get a fractional resize (and thus the option to choose your resampler).

This may be what I was seeing in my testing. I was using small images (only a few 100 px wide & tall) that were originally created in Affinity Designer from vector art, so they were not continuous tone images like photos. As I said, I did get slightly different results with the different resample settings & I was not resizing for export -- all exports used the original image size.

 

I will try to do some more testing to see if this theory pans out.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

Comparisons need to be done at (roughly) the same filesize. Like the OP, he tweaked the values so that they both give or take got the same filesizes (104kb and 100kb apparently). If the 100kb is clearly better looking then there is quality difference :P.

Apparently, it is not quite that simple. One of the articles I mentioned earlier cautions that this kind of comparison can be deceptive unless both files contain the same kind & amount of metadata. That is because since metadata contributes to file size but not image quality, if one file includes significantly more metadata that another of similar file size, it must have compressed the image with a lower effective quality setting to allow for the metadata 'overhead.'

 

This is why I was asking if the CS2 export was done using the "Save for Web" interface or the "Save as" one. According to the Photoshop Save As vs Save For Web article, Save for Web automatically removes EXIF metadata & optional JPEG "markers," described as "special markers used to indicate additional information or provide resiliency in the case of errors / corruption." That same article also mentions the 1-100 quality scale for Save for Web vs. the 1-12 one for Save As, so if I had been reading more carefully I would not have been confused by that. Even so, neither scale is a percent indicator because they are not linear. In the "Ordered Graph" near the end of the article this is shown clearly, particularly near the low end of the scale where luminance quality begins to fall off sharply beginning around the 20 setting, about the same as in canetti2's screenshot.

 

So if I understand this correctly (which I freely admit I may not), this would have the greatest effect on small files, where for example one ~100 KB file could include several tens of KB of metadata while another might have almost none. The article says the difference for CS2 between Save As & Save For Web could be around 40 KB, leaving only about 60 KB for image data in the Save As file vs. nearly twice that much for the Save For Web version.

 

If something similar is going on with the Affinity export, perhaps the fix could be as simple as a "Save For Web" preset that works like the CS2 one to remove the extra metadata?

 

Footnote: If anybody is interested, The Metadata in JPEG files page contains tons of technical data about the complex structure of EXIF, XMP, IPC, & ICC metadata that may be included in the various JPEG file format standards.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

Hi R C-R,

While  metadata can have influence in the file size it's still not the point here. If you want to remove metadata from the exported file in Affinity click on the More button in the Export dialog and untick Embed metadata.

I understand that. However, unless that option also removes any "marker" metadata that the file might contain, it would still contribute to the file size, leaving less room for image data. Do you know if it does?


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

 

 

Apparently, it is not quite that simple

It kinda is if the OP is clearly doing this to _NOT_ have to resort to external tools. That means you to do it with the tools inside of the photo-tool.

 

So if Photosave save-for-web is beating Affinity (by an apparently quite large effect) for the same file size then it's settled, right? How that filesize is achieved doesn't really matter. If Affinity leaves the metadata in than that doesn't matter to what's possible to get out of Affinity without external tools :).

 

The results can be _explained_ by including or excluding metadata or progressive or baseline or stuff like that... but results are results, and if Affinity doesn't give options to change, then the results are final.

 

I stated before that if you're willing to use external tools there come legion of options available to optimize how you see fit, but then it isn't relevant anymore to what you get 'as is' out of the photo program.

 

If you're asking "why stay 'inside' of Affinity, why don't allow some sort of external tools" then I'm inclined to agree, but apparently the OP isn't interested in that.

It seems he/she/they have a macro-workflow or something that saves a lot of time if it's saved directly from the program.. I don't know.

 

Saving it all als jpeg and then having a program strip metadata from all jpgs in a directory seems simple enough.

And then you might as well save everything as tif or png and have a program that puts all tif/png files in a directory through mozjpeg or a similar jpeg-optimizer :).

Share this post


Link to post
Share on other sites

If you're asking "why stay 'inside' of Affinity, why don't allow some sort of external tools" then I'm inclined to agree, but apparently the OP isn't interested in that.

All I'm asking is if Affinity strips out all the "marker" metadata when the "Embed metadata" option is unchecked. If it does not, then the fix might be fairly simple.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.