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

Exporting to png creates huge filesize


Recommended Posts

Hello

I've got an Affinity Photo file with many different Layers. And when I try to export it as an PNG (only 1-2 Layers, all other are not visible) it creates a file size sometimes over 40mb. I can't select that it should only export the visible files. Even when I select on the export window "only selected area" I still get this huge file sizes.

So how can I just export the visible Layer without anything else? That should be one of the most basic features and I can't find it. 
Thanks for heldp.

Link to comment
Share on other sites

Hello @captainelvis, and welcome to the forums.

It would help if you would give us some more information. How big is your image (Pixel dimensions)? What bit depth is your image (8-bit or 16-bit)?

It would also help if you could give a screenshot of the export dialogue.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

Hello @John Rostron and @MEB
My file size is 3840px x 3840px with 72dpi. And I guess I found some part of the troublemaker. I have a live-filter layer which adds noise and that in a negation (is the german word, don't know the english one) blend mode. If I don't have this one activated it reduces the size for about 10 to 20 MB but still massive. 

 

EDIT: So I tried it in Photoshop and got near or less the same result. So looks like you can't add noise without making the file size more than 2 times as big.

Bildschirmfoto 2022-01-19 um 17.02.31.png

Edited by captainelvis
Link to comment
Share on other sites

1 hour ago, captainelvis said:

So looks like you can't add noise without making the file size more than 2 times as big.

@captainelvis, you are quite right. The efficiency of the compression algorith used by png (and most other formats) will depend on how even the image is. The whole point of noise is to make the image more uneven which works against the compression algorithm.

John

Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Link to comment
Share on other sites

3 hours ago, captainelvis said:

Do you have an idea on how you could achieve a similar effect without the file size getting that huge?

Reducing the pixel dimensions to something considerably smaller than 3840 x 3840 px would reduce the file size but that will remove small scale details. That may or may not be acceptable depending on the image content & how grainy you want it to look.

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

Hi @captainelvis,
As explained above due to the way the PNG compression works I'm afraid there's no way to work around it, the more micro detail you add, the bigger the image will be. You may have better luck with JPG (if possible/applicable) which deals a bit better with color variation and also gives you some flexibility to adjust the compression level to find a balance between quality/file size. Depending on how/where are you using your image you may consider other (more recent) formats.

Link to comment
Share on other sites

When you export to PNG you should get just what is visible in the file when you have it open. Layers and objects do not matter, they all convert to single pixel image. That 3840px x 3840pfile is without any compression 44,3 MB. 

If you need to get smaller file and can accept lossy compression you can export to JPEG. It can compress noisy images but can introduce some artifacts to image.

Of course you have to decide what the file is for and select file type, resolution and compression accordingly.

Link to comment
Share on other sites

1 hour ago, MEB said:

the more micro detail you add, the bigger the image will be.

I don't normally worry too much about file size, but I just checked out a couple of images saved as PNG. The first, a normal colour image, is 9.45MB the second is an exact copy, I just added a black and white adjustment and then added some grain. The second file is 52.8MB! The only difference between them really is that the second one has more "noise". If I just make a B&W image, without the noise, the result is only 5.62MB, adding the noise seems to have increased the file size by about 10 times. I'm quite surprised just how large the increase is!

Untitled.jpg

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

Link to comment
Share on other sites

On 1/19/2022 at 11:31 AM, captainelvis said:

Do you have an idea on how you could achieve a similar effect without the file size getting that huge?

If you are a Mac user you may want to check out ImageOptim -- it is most effective at reducing JPEG file sizes but also has options for using different PNG compression algorithms & automatically choosing the one that results in the smallest file size, & for allowing & controlling the amount of lossy compression applied.

It is very easy to use & totally free.

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

On 1/19/2022 at 5:31 PM, captainelvis said:

...achieve a similar effect without the file size getting that huge?
...So any ideas would be welcomed.

Hi @captainelvis

You can try to increase the similarity of the pixel values by using a posterise adjustment.
There is a relationship between the posterise level and the final size/quality. Therefore, you will have to find the best compromise between size and quality.

I resized a JPG with 1920x1976 to 3840x2552 (naturepic)
The original JPG was 649 Kb.
After exporting, the PNG was 8.91 Mb

Final.jpg.4b39a97d1cffe38a8f8388ede99a1d87.jpg

I took a screenshot of the layers because the order of the adjustments is important in the final result.

Layers.png.1aac39dcb6b262e30bfe27d82cf1c331.png

Since posterise increased the contrast i used a Brightness Contrast adjustment to reduce the contrast.

Link to comment
Share on other sites

10 hours ago, PaulEC said:

adding the noise seems to have increased the file size by about 10 times. I'm quite surprised just how large the increase is!

If you want an extreme difference, fill the image with one color, and then the other with the same color but with the noise set.

Most formats use simple RLE compression (already used in the old BMP format), which uses the same color repetition. The more times the color is repeated, the better and more efficiently the data is compressed. The noise then completely eliminates this compression, or it can even negate its effect, so compression increases the data.

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

7 hours ago, Pšenda said:

If you want an extreme difference, fill the image with one color, and then the other with the same color but with the noise set.

Most formats use simple RLE compression (already used in the old BMP format), which uses the same color repetition. The more times the color is repeated, the better and more efficiently the data is compressed. The noise then completely eliminates this compression, or it can even negate its effect, so compression increases the data.

I'd already done the two versions of this image, but I only realised the huge difference in file size when I read this post and thought I'd see how much difference adding some noise actually made! I'm used to artefacts/noise affecting file size with PDF files (mainly due to trying to reduce the file size of plans for the Land Registry, who insist on plans to exact scale but have a ridiculously small size limit!) but I hadn't realised how much it also affects PNGs. You can learn something new every day. 😉

Acer XC-895 : Core i5-10400 Hexa-core 2.90 GHz :  32GB RAM : Intel UHD Graphics 630 : Windows 10 Home
Affinity Publisher 2 : Affinity Photo 2 : Affinity Designer 2 : (latest release versions) on desktop and iPad

Link to comment
Share on other sites

4 hours ago, PaulEC said:

also affects PNGs

The effect of breaking full-color surfaces (noise, gradient, blur) is visible mainly in lossless compression algorithms, especially in PNG.
For the exam, I made a picture of 3840x2160px, which I filled in one color. After exporting to PNG (without ICC and metadata) it has 29,439 B.
Then I added noise to the fill color (100%) and it has 2,406,041 B (ie about 100 times larger).
Then I filled the image with a color diagonal gradient, and it has 5,939,163 B.
And then I added noise to both colors of the gradient, and it has 16,217,947 B.
So the same size image, same format, but depending on the content more than 500 times larger size file 🙂

Affinity Store (MSI/EXE): Affinity Suite (ADe, APh, APu) 2.4.0.2301
Dell OptiPlex 7060, i5-8500 3.00 GHz, 16 GB, Intel UHD Graphics 630, Dell P2417H 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Dell Latitude E5570, i5-6440HQ 2.60 GHz, 8 GB, Intel HD Graphics 530, 1920 x 1080, Windows 11 Pro, Version 23H2, Build 22631.3155.
Intel NUC5PGYH, Pentium N3700 2.40 GHz, 8 GB, Intel HD Graphics, EIZO EV2456 1920 x 1200, Windows 10 Pro, Version 21H1, Build 19043.2130.

Link to comment
Share on other sites

16 hours ago, Pšenda said:

If you want an extreme difference, fill the image with one color, and then the other with the same color but with the noise set.

Indeed, just adding a small amount of blur can make a large difference in file size. In the attached zip are 3 png files plus the afphoto file I used to make them. The afphoto file has snapshots & history saved in it so you can repeat what I did if you want.

The document size is 800 px square. "plain.png" is the export of the solid color with no noise applied. Its size is a mere 5 KB. "100%.png" has 100% monochrome Gaussian noise applied, bumping the size up to 1.9MB. "blurred.png" is the same as 100%.png except I added a 1 px Gaussian blur to it. That reduced the size to 791KB. 

Increasing the blur radius results in proportionally smaller file sizes, but of course that greatly reduces the graininess of the image. So the bottom line is you can't have both a very grainy look & a small file size at the same time.

PNG noise test.zip

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

  • 1 year later...

Here's what helped me when I had the same issue....make your document size A LOT smaller. I cut my document size down to like 1/4 of the original size and that COMPLETELY fixed the issue of large export file sizing. I didn't lose any integrity or detail in the project.

 

HOPE THIS HELPS!

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.