Re: [Gimp-user] Scaled image larger in file size than original

2009-09-17 Thread Sven Neumann
Hi,

 I took KSnapshot out of the picture, and took the screenshot with Gimp,
 saved it as a png. The file size was 35k. I scaled the image by 50%
 and saved it as a new png. The file size was 44k.
 
 I reduced the file by 50% using imageMagick and the file size was 71k.
 
 convert file1.png -resize 50% file3.png
 
 I did an imagemagick identify on file2 (44k) and file3 (71k), and they
 both display the dimensions as 340x272.
 
 The image is a snapshot of the body of the KDE Kate editor, which is
 mostly text.

Oh, then the answer is simple. The scaled-down version compresses not as
good as the original size. PNG uses run-length compression, which works
very nicely on graphics that have areas of solid colors. By scaling down
the image, you make the image less suitable for this kind of
compression.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Scaled image larger in file size than original

2009-09-17 Thread erniew
Sven Neumann wrote: 

 Hi, 
 
 I took KSnapshot out of the picture, and took the screenshot with Gimp, 
 saved it as a png. The file size was 35k. I scaled the image by 50% 
 and saved it as a new png. The file size was 44k. 
 
 I reduced the file by 50% using imageMagick and the file size was 71k. 
 
 convert file1.png -resize 50% file3.png 
 
 I did an imagemagick identify on file2 (44k) and file3 (71k), and they 
 both display the dimensions as 340x272. 
 
 The image is a snapshot of the body of the KDE Kate editor, which is 
 mostly text. 
 
 Oh, then the answer is simple. The scaled-down version compresses not as 
 good as the original size.

To clarify:  The original image probably contains a relatively small
number of distinct colors.  Resizing by 50% introduces a large number
of new colors that are shades of the original.  (Resizing doesn't simply
throw away 3/4 of the pixels.  Each new pixel is an average of several
original pixels.)  The smaller image is actually much more complex than
the larger one and therefore more difficult to compress using PNG's
method.

 PNG uses run-length compression,

The compression is lossless, but it's not run-length.  PNG uses an LZ77
derivative.

But this:

 which works very nicely on graphics that have areas of solid colors.
 By scaling down the image, you make the image less suitable for this
 kind of compression. 

remains true.

- Ernie
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Scaled image larger in file size than original

2009-09-17 Thread Sven Neumann
Hi,

On Thu, 2009-09-17 at 20:13 +, ern...@comcast.net wrote:

  PNG uses run-length compression,
 
 The compression is lossless, but it's not run-length.  PNG uses an LZ77
 derivative.

Thanks for the correction.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Scaled image larger in file size than original

2009-09-15 Thread DJ
Hi Gimp-user,

I took a screenshot of a region using KSnapshot, and saved it as a
png.  I know I can take a screenshot with Gimp, but KSnapshot sits in
the tray and is always there.  Sometimes I take a snapshot of a debug
or error window when I can't grab the text, and use it temporarily
while debugging. This screenshot I wanted to keep. :-)

I opened the screenshot in Gimp and saved it as another name, but
still a png.  I then scaled the image by 80% to reduce the size,
and saved the file as a png.

KSnapshot png save: 70k
Gimp png save: 68k
Gimp scale png: 263k

When I saved in Gimp, the Compression was at level 9, and no
checkboxes were checked.

What am I missing here, why does the scaled version of the png have a
larger file size?

Thank you.

-- 
__ 
DJ   


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Scaled image larger in file size than original

2009-09-15 Thread Sven Neumann
On Tue, 2009-09-15 at 15:16 -0500, DJ wrote:

 I opened the screenshot in Gimp and saved it as another name, but
 still a png.  I then scaled the image by 80% to reduce the size,
 and saved the file as a png.
 
 KSnapshot png save: 70k
 Gimp png save: 68k
 Gimp scale png: 263k
 
 When I saved in Gimp, the Compression was at level 9, and no
 checkboxes were checked.
 
 What am I missing here, why does the scaled version of the png have a
 larger file size?

You did not by any chance convert the image from Indexed to RGB mode,
did you?


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user