Re: [Gimp-developer] [PATCH] OpenRaster: optimize PNG saving

2010-03-13 Thread Martin Nordholts
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 jono...@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


Re: [Gimp-developer] [PATCH] OpenRaster: optimize PNG saving

2010-03-12 Thread Jon Nordby
On Sat, Mar 6, 2010 at 3:30 PM, Martin Nordholts ense...@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


0001-OpenRaster-optimize-PNG-saving-2.patch
Description: Binary data
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] [PATCH] OpenRaster: optimize PNG saving

2010-03-06 Thread Martin Nordholts
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


Re: [Gimp-developer] [PATCH] OpenRaster: optimize PNG saving

2010-03-06 Thread Sven Neumann
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


Re: [Gimp-developer] [PATCH] OpenRaster: optimize PNG saving

2010-03-06 Thread Liam R E Quin
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


[Gimp-developer] [PATCH] OpenRaster: optimize PNG saving

2010-02-27 Thread Jon Nordby
From 0e41e65f31ae07c91f2ed5dc8f0c51d05949be51 Mon Sep 17 00:00:00 2001
From: Jon Nordby jono...@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


0001-OpenRaster-optimize-PNG-saving.patch
Description: Binary data
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer