RSS/Atom feed Twitter
Site is read-only, email is disabled

Scaled image larger in file size than original

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

Scaled image larger in file size than original DJ 15 Sep 22:16
  Scaled image larger in file size than original Sven Neumann 15 Sep 22:47
545798226.20090916195025@ya... 07 Oct 20:20
  Scaled image larger in file size than original Sven Neumann 17 Sep 19:12
   Scaled image larger in file size than original erniew@comcast.net 17 Sep 22:13
    Scaled image larger in file size than original Sven Neumann 17 Sep 22:30
DJ
2009-09-15 22:16:11 UTC (over 15 years ago)

Scaled image larger in file size than original

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.

Sven Neumann
2009-09-15 22:47:07 UTC (over 15 years ago)

Scaled image larger in file size than original

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

Sven Neumann
2009-09-17 19:12:59 UTC (over 15 years ago)

Scaled image larger in file size than original

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

erniew@comcast.net
2009-09-17 22:13:53 UTC (over 15 years ago)

Scaled image larger in file size than original

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

Sven Neumann
2009-09-17 22:30:56 UTC (over 15 years ago)

Scaled image larger in file size than original

Hi,

On Thu, 2009-09-17 at 20:13 +0000, erniew@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