gimpusers.com logo
German version English version

Not logged in

Sign up! | Lost password?

Latest discussion

  1. gimp-user | today 10:48 AM
    Suppressing the "press any character to close this window" message in Script-Fu
  2. gimp-developer | today 10:45 AM
    Help with new default resources in 2.8
  3. gimp-docs | today 10:34 AM
    Where does the HTML documentation
  4. gimp-developer | today 09:34 AM
    html layers
  5. gimp-developer | today 08:50 AM
    Please fix Color and/or Value transfer mode

External news

Poll

Would you like to see or even participate in GFX contests hosted by gimpusers.com?

Yes, but prices for winners are important!

Yes, GFX contests are a good idea! It brings community together even if there are no prices available

No, contests are not important

Maybe, it is however not a tragedy if there are no contests. I don't care much.

See results

Stats

gimpusers.com RSS feed

GIMP Forums » For GIMP developers

[PATCH] OpenRaster: optimize PNG saving

Jump to message:

  1. [PATCH] OpenRaster:... — Jon Nordby, 27 Feb 2010 03:14 PM
    1. [PATCH] OpenRaster:... — Martin Nordholts, 06 Mar 2010 03:27 PM
      1. [PATCH] OpenRaster:... — Sven Neumann, 06 Mar 2010 04:35 PM
        1. [PATCH] OpenRaster:... — Liam R E Quin, 06 Mar 2010 07:04 PM
      2. [PATCH] OpenRaster:... — Jon Nordby, 12 Mar 2010 11:09 PM
        1. [PATCH] OpenRaster:... — Martin Nordholts, 13 Mar 2010 12:23 PM

As a registered user, you can subscribe forum threads in order to get notified when replies are posted. Just log in at the right top of the page if you already have an account, otherwise you can register for free.

Permalink:f3e52ed61002270614k334ce6b0o3f4569dd9...
Date:27 Feb 2010 03:14 PM
From:Jon Nordby
Subject:[PATCH] OpenRaster: optimize PNG saving
>From 0e41e65f31ae07c91f2ed5dc8f0c51d05949be51 Mon Sep 17 00:00:00 2001
From: Jon Nordby <jononor@gmail.com>
Date: Sat, 27 Feb 2010 14:28:58 +0100
Subject: [PATCH] OpenRaster: optimize PNG saving

Sets lower compression and disables interlacing.
On a 5 layer image of 4500x6000px this gives an order of magnitude better
save-times, with 50% increase in file size.
---
plug-ins/pygimp/plug-ins/file-openraster.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plug-ins/pygimp/plug-ins/file-openraster.py
b/plug-ins/pygimp/plug-ins/file-openraster.py
index 2016c2b..eeefe13 100755
--- a/plug-ins/pygimp/plug-ins/file-openraster.py
+++ b/plug-ins/pygimp/plug-ins/file-openraster.py
@@ -85,7 +85,7 @@ def save_ora(img, drawable, filename, raw_filename):

def store_layer(img, drawable, path):
tmp = os.path.join(tempdir, 'tmp.png')
- pdb['file-png-save-defaults'](img, drawable, tmp, 'tmp.png')
+ pdb['file-png-save'](img, drawable, tmp, 'tmp.png', 0, 2, 1, 1, 1, 1, 1)
orafile.write(tmp, path)
os.remove(tmp)
--
1.7.0



--
Regards Jon Nordby - www.jonnor.com

_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:4B9266EA.6050104@gmail.com
Date:06 Mar 2010 03:27 PM
From:Martin Nordholts
Subject:[PATCH] OpenRaster: optimize PNG saving
On 02/27/2010 03:14 PM, Jon Nordby wrote:
> Sets lower compression and disables interlacing.
> On a 5 layer image of 4500x6000px this gives an order of magnitude better
> save-times, with 50% increase in file size.

Hi Jon

Sorry for the late follow-up and thanks for maintaining the ORA plug-in.

50% increase in file size is pretty significant, maybe the compression
ratio should be exposed in a UI?


> @@ -85,7 +85,7 @@ def save_ora(img, drawable, filename, raw_filename):
>
> def store_layer(img, drawable, path):
> tmp = os.path.join(tempdir, 'tmp.png')
> - pdb['file-png-save-defaults'](img, drawable, tmp, 'tmp.png')
> + pdb['file-png-save'](img, drawable, tmp, 'tmp.png', 0, 2, 1, 1, 1, 1, 1)

It would be nice to make 0, 2, 1, 1, 1, 1, 1 immediately interpretable,
for example by commenting or using local variables like so:

embed_profile = 1
function(1, # save_comment
embed_profile)


BR,
Martin
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:1267889723.27890.2.camel@bender
Date:06 Mar 2010 04:35 PM
From:Sven Neumann
Subject:[PATCH] OpenRaster: optimize PNG saving
On Sat, 2010-03-06 at 15:30 +0100, Martin Nordholts wrote:
> On 02/27/2010 03:14 PM, Jon Nordby wrote:
> > Sets lower compression and disables interlacing.
> > On a 5 layer image of 4500x6000px this gives an order of magnitude better
> > save-times, with 50% increase in file size.
>
> Hi Jon
>
> Sorry for the late follow-up and thanks for maintaining the ORA plug-in.
>
> 50% increase in file size is pretty significant, maybe the compression
> ratio should be exposed in a UI?

IMO 50% increase in file size is not much for a file format that is
meant for archival and exchange of images. It's not that people are
likely to use OpenRaster files on web-pages or the like. Being able to
save quickly seems much more important than file-size here.


Sven
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:1267898650.7386.46.camel@desktop.bare...
Date:06 Mar 2010 07:04 PM
From:Liam R E Quin
Subject:[PATCH] OpenRaster: optimize PNG saving
On Sat, 2010-03-06 at 16:35 +0100, Sven Neumann wrote:
[...]
> IMO 50% increase in file size is not much for a file format that is
> meant for archival and exchange of images.

Archival - it'd mean an extra 20 gigabytes to back up for one of
my "old books" archives for example.
Interchange - the difference between 100 megabytes and 150 megabytes for
an image seems at the least noticeable to me, and that's for an 8bit per
channel grayscale image. (I'd be using 16 bits if the tools I had
supported it a little better)

> It's not that people are
> likely to use OpenRaster files on web-pages or the like. Being able to
> save quickly seems much more important than file-size here.
I don't mind waiting 10 minutes to save a file for archiving, especially
as GIMP lets me do other things in the meantime.

My vote here is for exposing it in the UI, as with export to PNG, as
it's clearly different for different people.

Liam
--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org

_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:f3e52ed61003121409m4162ec5el1dee1cca2...
Date:12 Mar 2010 11:09 PM
From:Jon Nordby
Subject:[PATCH] OpenRaster: optimize PNG saving
On Sat, Mar 6, 2010 at 3:30 PM, Martin Nordholts <enselic@gmail.com> wrote:

> On 02/27/2010 03:14 PM, Jon Nordby wrote:
> > Sets lower compression and disables interlacing.
> > On a 5 layer image of 4500x6000px this gives an order of magnitude better
> > save-times, with 50% increase in file size.
>
> Hi Jon
>
> Sorry for the late follow-up and thanks for maintaining the ORA plug-in.
>
> 50% increase in file size is pretty significant, maybe the compression
> ratio should be exposed in a UI?
>
First some absolute numbers (rough measurements) so we don't get lost in
relative figures.
Saving said image on a 2Ghz core2duo with enough memory too keep it from
swapping yields:
xcf - 150MB - under 10 seconds
xcf.gz - 65MB - about 23 seconds
ora, before patch (maximum compression) - 48MB - about 7 minutes
ora, after patch - 63MB - about 30 seconds

Do you really think there it is a big point to introduce a UI for selecting
compression?
In my experience, the predominant usecase for OpenRaster seems to be for
interchange between different applications when working locally. And for
that I don't see the point.


> > @@ -85,7 +85,7 @@ def save_ora(img, drawable, filename, raw_filename):
> >
> > def store_layer(img, drawable, path):
> > tmp = os.path.join(tempdir, 'tmp.png')
> > - pdb['file-png-save-defaults'](img, drawable, tmp, 'tmp.png')
> > + pdb['file-png-save'](img, drawable, tmp, 'tmp.png', 0, 2, 1, 1, 1, 1,
> 1)
>
> It would be nice to make 0, 2, 1, 1, 1, 1, 1 immediately interpretable,
> for example by commenting or using local variables like so:
>
> embed_profile = 1
> function(1, # save_comment
> embed_profile)
>
You are right. Attached patch addresses this.
--
Regards Jon Nordby - www.jonnor.com

_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview
Permalink:4B9B7649.4080407@gmail.com
Date:13 Mar 2010 12:23 PM
From:Martin Nordholts
Subject:[PATCH] OpenRaster: optimize PNG saving
On 03/12/2010 11:09 PM, Jon Nordby wrote:
> Do you really think there it is a big point to introduce a UI for
> selecting compression?

Nah maybe not.

> It would be nice to make 0, 2, 1, 1, 1, 1, 1 immediately interpretable,
> for example by commenting or using local variables like so:
>
> embed_profile = 1
> function(1, # save_comment
> embed_profile)
>
> You are right. Attached patch addresses this.

Thanks, much better, I've pushed the commit now:

commit 614714d980b906ec8ee049d1f6ea90681640c07a
Author: Jon Nordby <jononor@gmail.com>
Date: Fri Mar 12 23:01:24 2010 +0100

plug-ins: Optimize OpenRaster PNG saving

Sets lower compression and disables interlacing.
On a 5 layer image of 4500x6000px this gives an order of magnitude
better
save-times, with 50% increase in file size.


/ Martin
--

My GIMP Blog:
http://www.chromecode.com/
"Multi-column dock windows and 2.8 schedule"
_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
↑Back to thread overview

Adobe® Photoshop® is a registered trademark of Adobe Systems, Inc. Linux is a trademark of Linus Torvalds. Ubuntu and Canonical are registered trademarks of Canonical Ltd. | Clock times are shown as CET / CEST | Imprint / Privacy policy | powered by bitfire it services | sponsored by Hirners Hotel Guide