Gimp-Forum.net
ht set default compression level for png export? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: ht set default compression level for png export? (/Thread-ht-set-default-compression-level-for-png-export)



ht set default compression level for png export? - ottenm - 01-31-2025

On the "Export Image as PNG" dialog, my compression level was set to 9, causing png exports to take over 60s.  If I set it to 4, about 2s.  Awesome, but the next time the dialog comes up: 9.  Is there a way to set this permanently to 4?  (either inside gimp, or somewhere out in config/options/settings files)


RE: ht set default compression level for png export? - programmer_ceds - 01-31-2025

(01-31-2025, 01:20 PM)ottenm Wrote: On the "Export Image as PNG" dialog, my compression level was set to 9, causing png exports to take over 60s.  If I set it to 4, about 2s.  Awesome, but the next time the dialog comes up: 9.  Is there a way to set this permanently to 4?  (either inside gimp, or somewhere out in config/options/settings files)
If you are using V2.10.38 set the compression value that you want then click the "Save Defaults" button.

With V3.0.0 RC2 the last used values are presented when exporting a png - alternatively you can save and re-load settings - so V3.0.0.RC2 would do what you want.


RE: ht set default compression level for png export? - Tas_mania - 02-01-2025

PNG compression is set on a file by file basis.

[attachment=13034]

Does anyone know of a 'global' Gimp setting for the PNG compression value?
I use ofn-export-all-files and it uses the default compression of 9.


RE: ht set default compression level for png export? - Ofnuts - 02-01-2025

Did you try to export a PNG "manually", set the compression to 5, and hit Save defaults before hitting Export?


RE: ht set default compression level for png export? - Tas_mania - 02-01-2025

I investigated this.
First I found my ofn-export-layers was from 2018.
I upgraded to one from 2023 that has the pop-up 'Export Image as PNG'.
I found the PNG file size increased as I reduced 'compression level'.
I checked the built-in 'Export As...' 
It did the same so I assume the ofn script uses the Gimp 'Export As'

The frames I used were jpg and about 800kb. By exporting as PNG they went up to 3.2Mb and as high as 4.2Mb.
I'm using Gimp 2.10.38 appimage that may have a bug in it.


RE: ht set default compression level for png export? - Ofnuts - 02-01-2025

(02-01-2025, 06:02 AM)Tas_mania Wrote: I investigated this.
First I found my ofn-export-layers was from 2018.
I upgraded to one from 2023 that has the pop-up 'Export Image as PNG'.
I found the PNG file size increased as I reduced 'compression level'.
I checked the built-in 'Export As...' 
It did the same so I assume the ofn script uses the Gimp 'Export As'

The frames I used were jpg and about 800kb. By exporting as PNG they went up to 3.2Mb and as high as 4.2Mb.
I'm using Gimp 2.10.38 appimage that may have a bug in it.

Depending on content it is normal to find the PNG bigger than the JPG. In addition if you use high precision images (16-bit or more) the PNG is by default (automatic pixelformat) saved as a 16-bit PNG which doubles its size.

If you use the version with the dialog, the script uses the dialog values for all the layers.