gimpusers.com logo
German version English version

Not logged in

Sign up! | Lost password?

Latest discussion

  1. gegl-developer | today 12:12 AM
    babl docs
  2. gimp-web | yesterday 10:41 PM
    Windows installers
  3. gimp-user | yesterday 10:23 PM
    How to edit text in both Gimp & Photoshop
  4. gimp-docs | yesterday 05:54 PM
    a new user perspective
  5. gimp-developer | yesterday 07:03 AM
    Nightly builds with buildbot, where can we host?

External news

Poll

How good are you at programming?

OMG, that is nothing for me at all!

I've been coding a little bit but I'm not very fit at it

I'm pretty good at programming and would maybe be able to write a Plug-In for GIMP

I'm very good at programming and I would theoretically be able to hack for the GIMP core

See results

Stats

gimpusers.com RSS feed

GIMP Forums » For GIMP users

Rotate increases PNG size x10 !

Jump to message:

  1. message 4C233E96.9030501@pricom.com.au not available
    1. Rotate increases PNG... — Chris Mohler, 24 Jun 2010 06:54 PM
      1. Rotate increases PNG... — Philip Rhoades, 24 Jun 2010 07:10 PM
      2. Rotate increases PNG... — Philip Rhoades, 25 Jun 2010 04:45 PM
        1. Rotate increases PNG... — Branko Vukelic, 25 Jun 2010 04:54 PM
          1. Rotate increases PNG... — Philip Rhoades, 25 Jun 2010 05:04 PM
  2. Rotate increases PNG... — Philip Rhoades, 23 Jun 2010 08:07 PM
    1. Rotate increases PNG... — Branko Vukelic, 24 Jun 2010 12:04 AM
      1. Rotate increases PNG... — Leon Brooks, 24 Jun 2010 12:30 AM
        1. Rotate increases PNG... — Chris Mohler, 24 Jun 2010 02:08 AM
          1. Rotate increases PNG... — Claus Cyrny, 24 Jun 2010 04:13 PM
          2. Rotate increases PNG... — Philip Rhoades, 24 Jun 2010 07:05 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:AANLkTinh_1kdkw6KXmPXRUeHj58RbqBE2OoP...
Date:24 Jun 2010 06:54 PM
From:Chris Mohler
Subject:Rotate increases PNG size x10 !
On Thu, Jun 24, 2010 at 6:16 AM, Philip Rhoades <phil@pricom.com.au> wrote:
> Confirmation of what is going on from the gurus would be appreciated!

It was as I guessed - the scans are in grayscale mode but the contents
are essentially a 1-bit image.

Open a scan, do image->mode->bitmap, choose 1-bit palette. Then
rotate and save - the file size will be comparable to the original.

Your image has that fine dot pattern all over the place - that's what
(I think) is causing the huge size blowup when rotated. Open a scan,
zoom to 100% or greater and look at the character of those small dots.
If you rotate the image in grayscale mode, look at the dots again at
100% or greater - they are now quite blurry. Where each dot was n
pixels of solid black, now each dot is something like n+5 pixels of
shades of gray, which makes the image harder to compress efficiently.

On the file increase when just saving - see here:
$ identify TestScanningDoc.png
TestScanningDoc.png PNG 2552x3523 2552x3523+0+0 PseudoClass 2c 8-bit
230.383kb 0.740u 0:02

$ identify TestScanningDoc_nochange.png
TestScanningDoc_nochange.png PNG 2552x3523 2552x3523+0+0 PseudoClass
256c 8-bit 366.076kb 0.870u 0:02

It appears the original has a 2-color palette, while the unchanged,
saved image has a 256-color palette.

HTH,
Chris
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:4C239186.2030907@pricom.com.au
Date:24 Jun 2010 07:10 PM
From:Philip Rhoades
Subject:Rotate increases PNG size x10 !
Chris,


On 2010-06-25 02:54, Chris Mohler wrote:
> On Thu, Jun 24, 2010 at 6:16 AM, Philip Rhoades<phil@pricom.com.au> wrote:
>> Confirmation of what is going on from the gurus would be appreciated!
>
> It was as I guessed - the scans are in grayscale mode but the contents
> are essentially a 1-bit image.
>
> Open a scan, do image->mode->bitmap, choose 1-bit palette. Then
> rotate and save - the file size will be comparable to the original.
>
> Your image has that fine dot pattern all over the place - that's what
> (I think) is causing the huge size blowup when rotated. Open a scan,
> zoom to 100% or greater and look at the character of those small dots.
> If you rotate the image in grayscale mode, look at the dots again at
> 100% or greater - they are now quite blurry. Where each dot was n
> pixels of solid black, now each dot is something like n+5 pixels of
> shades of gray, which makes the image harder to compress efficiently.
>
> On the file increase when just saving - see here:
> $ identify TestScanningDoc.png
> TestScanningDoc.png PNG 2552x3523 2552x3523+0+0 PseudoClass 2c 8-bit
> 230.383kb 0.740u 0:02
>
> $ identify TestScanningDoc_nochange.png
> TestScanningDoc_nochange.png PNG 2552x3523 2552x3523+0+0 PseudoClass
> 256c 8-bit 366.076kb 0.870u 0:02
>
> It appears the original has a 2-color palette, while the unchanged,
> saved image has a 256-color palette.


I resent my second mail (without the attachment) before reading your
response - sorry about that . .

Many thanks for the explanations - I appreciate it.

Regards,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil@pricom.com.au
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:4C24C114.7020308@pricom.com.au
Date:25 Jun 2010 04:45 PM
From:Philip Rhoades
Subject:Rotate increases PNG size x10 ! - next Q
Chris,


On 2010-06-25 02:54, Chris Mohler wrote:
> On Thu, Jun 24, 2010 at 6:16 AM, Philip Rhoades<phil@pricom.com.au> wrote:
>> Confirmation of what is going on from the gurus would be appreciated!
>
> It was as I guessed - the scans are in grayscale mode but the contents
> are essentially a 1-bit image.
>
> Open a scan, do image->mode->bitmap, choose 1-bit palette.


I had to do:

image->mode->indexed->1bit


> Then
> rotate and save - the file size will be comparable to the original.


OK, so now the next question is: If the original is recognised by
"identify" as a 1 bit per pixel image, why doesn't Gimp keep it that way
when opening the file? At 300dpi there is no real issue with "jaggy"
edges - is it just a judgement call that a conversion to grey scale is
likely to give the best result for most situations and the file size is
a secondary consideration?

Thanks,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil@pricom.com.au
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:AANLkTin_Kk98gpJ2Xs0vWPLbNxMnk-d7iXcc...
Date:25 Jun 2010 04:54 PM
From:Branko Vukelic
Subject:Rotate increases PNG size x10 ! - next Q
On Fri, Jun 25, 2010 at 4:45 PM, Philip Rhoades <phil@pricom.com.au> wrote:
> OK, so now the next question is:  If the original is recognised by
> "identify" as a 1 bit per pixel image, why doesn't Gimp keep it that way
> when opening the file?  At 300dpi there is no real issue with "jaggy"
> edges - is it just a judgement call that a conversion to grey scale is
> likely to give the best result for most situations and the file size is
> a secondary consideration?

If the image was produced as 1bpp to begin with, I don't think
converting to Greyscale will help a lot. Maybe with rotation, but
otherwise, there should be little advantage.
--
Branko Vukelić

bg.branko@gmail.com
studio@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:4C24C58D.8060204@pricom.com.au
Date:25 Jun 2010 05:04 PM
From:Philip Rhoades
Subject:Rotate increases PNG size x10 ! - next Q
Branko,


On 2010-06-26 00:54, Branko Vukelic wrote:
> On Fri, Jun 25, 2010 at 4:45 PM, Philip Rhoades<phil@pricom.com.au> wrote:
>> OK, so now the next question is: If the original is recognised by
>> "identify" as a 1 bit per pixel image, why doesn't Gimp keep it that way
>> when opening the file? At 300dpi there is no real issue with "jaggy"
>> edges - is it just a judgement call that a conversion to grey scale is
>> likely to give the best result for most situations and the file size is
>> a secondary consideration?
>
> If the image was produced as 1bpp to begin with, I don't think
> converting to Greyscale will help a lot. Maybe with rotation, but
> otherwise, there should be little advantage.


The question was - why does Gimp make the change automatically? - it
shouldn't in my view.

Thanks,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil@pricom.com.au
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:4C224D60.5090503@pricom.com.au
Date:23 Jun 2010 08:07 PM
From:Philip Rhoades
Subject:Rotate increases PNG size x10 !
People,

I used:

xsane-0.997-3.fc12.x86_64

to scan an A4 page at 300dpi in LineArt mode and got a file of:

325,668 t_xsane.png

I then edited it using:

gimp-2.6.8-1.fc12.x86_64

rotating the image by -0.7 and cropping slightly - the resulting image
was 10 times the size!:

3,368,891 t_xsane_-0.7.png

As another test I simply opened the original file and saved it with a
new name - this gave about a 33% increase in size:

478,305 t_xsane_nochange.png

What is going on with these size increases?

Thanks,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil@pricom.com.au
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:AANLkTin3UAbfZvb7pkCtuDd6ExV8EE2oFYb4...
Date:24 Jun 2010 12:04 AM
From:Branko Vukelic
Subject:Rotate increases PNG size x10 !
On Wed, Jun 23, 2010 at 8:07 PM, Philip Rhoades <phil@pricom.com.au> wrote:
> What is going on with these size increases?

It may be that after rotation, pixels that were otherwise the same
color got anti-aliased and were slightly different color. This would
increase the image size. Can you show us the original scan?

Regards,
--
Branko Vukelić

bg.branko@gmail.com
studio@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:201006240630.49004.leon-gimp@cyberkni...
Date:24 Jun 2010 12:30 AM
From:Leon Brooks
Subject:Rotate increases PNG size x10 !
On Thu, 24 Jun 2010 06:04:57 am Branko Vukelic wrote:
> On Wed, Jun 23, Philip Rhoades wrote:
>> What is going on with these size increases?

> It may be that after rotation, pixels that were
> otherwise the same color got anti-aliased and were
> slightly different color. This would increase the
> image size.

Branco, that may account for the increased size of a
_rotated_ image, but Phil also increased the size simply
during a re-save of an unchanged image.

Phil, I suspect that when re-saving that image, you may
wish to check the Advanced Settings popup to ensure that
the PNG compression ratio is set to maximum at the time.

WRT the rotated image, it wouldn't so much be anti-
aliasing as that the rotation is unlikely to be precisely
right-angled, so pixels along edges would be partially
coloured, which would make the PNG compression process
less efficient.

If the image is text or something else essentially
monochrome, Phil might try desaturating, then (regardless
of desat) Auto/Stretch Contrast. This should minimise
colour-gradient effects somewhat, so provide for more
effective compression.

If minute details are not so important, saving as JPeG
will reduce the size massively without serious loss of
visual quality. Loss of quality can be adjusted to a
reasonable compromise level within the JPeG settings
during SaveAs.

Cheers; Leon
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:AANLkTimkF9Vi0-aNgX2tuxt0M3J1DOqYLnaz...
Date:24 Jun 2010 02:08 AM
From:Chris Mohler
Subject:Rotate increases PNG size x10 !
On Wed, Jun 23, 2010 at 5:30 PM, Leon Brooks
<leon-gimp@cyberknights.com.au> wrote:
> If the image is text or something else essentially
> monochrome

Or image->mode, bitmap, 1-bit palette should drastically reduce the
file size. I suspect that the 'line art' setting in xsane is
producing a grayscale image but with each pixel either solid black or
solid white, which would make the resulting PNG easy to compress.
Rotating likely causes many pixels to become shades of gray along the
edges and increasing the file size.

My scanner is dead or I'd test this out myself.

Not sure on the increase when saving the image as-is - are all of the
'Save Comment', 'Save Creation', etc. boxes unchecked in the PNG save
dialog?

Chris
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:4C236826.3010801@web.de
Date:24 Jun 2010 04:13 PM
From:Claus Cyrny
Subject:Rotate increases PNG size x10 !
Chris Mohler wrote:
> On Wed, Jun 23, 2010 at 5:30 PM, Leon Brooks
> <leon-gimp@cyberknights.com.au> wrote:
>
>> If the image is text or something else essentially
>> monochrome
>>
>
> Or image->mode, bitmap, 1-bit palette should drastically reduce the
> file size. I suspect that the 'line art' setting in xsane is
> producing a grayscale image but with each pixel either solid black or
> solid white, which would make the resulting PNG easy to compress.

The downside would be that the text is jaggy. If it's just black or gray
text on a white background, I would convert the image to indexed,
with, say 32 colors. For text, this should be enough. My guess is that
the large file is in RGB--thus the big file size.

Claus

P.S.: Is it true that future Gimp versions won't have an indexed
mode anymore?
--
Webdesign + Grafik + Fotografie <http://home.arcor.de/ccyrny/> | Flickr
<http://www.flickr.com/photos/claus_01/> | artificial 1.0: visual arts
blog <http://artificial10.wordpress.com/>

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑Back to thread overview
Permalink:4C239055.1030506@pricom.com.au
Date:24 Jun 2010 07:05 PM
From:Philip Rhoades
Subject:Rotate increases PNG size x10 ! - resending
People,

I am resending this - the firsts attempt with the attachment didn't make
it apparently . . I can provide it if anyone is interested . .


On 2010-06-24 10:08, Chris Mohler wrote:
> On Wed, Jun 23, 2010 at 5:30 PM, Leon Brooks
> <leon-gimp@cyberknights.com.au> wrote:
>> If the image is text or something else essentially
>> monochrome
>
> Or image->mode, bitmap, 1-bit palette should drastically reduce the
> file size. I suspect that the 'line art' setting in xsane is
> producing a grayscale image but with each pixel either solid black or
> solid white, which would make the resulting PNG easy to compress.
> Rotating likely causes many pixels to become shades of gray along the
> edges and increasing the file size.
>
> My scanner is dead or I'd test this out myself.
>
> Not sure on the increase when saving the image as-is - are all of the
> 'Save Comment', 'Save Creation', etc. boxes unchecked in the PNG save
> dialog?


I produced a test PNG which resembles my actual pages and confirm my
previous results - original file attached (it was deliberately scanned
not square):

235,913 TestScanningDoc.png
3,184,862 TestScanningDoc_-1.0Rotate.png
374,903 TestScanningDoc_NoChange.png

I used the Gimp defaults when saving the files - compression was set at
the max of 9.

Confirmation of what is going on from the gurus would be appreciated!

BTW, I got around the real world problem by rescanning my actual pages
(which were themselves photocopies and NOT squarely produced) by
manually rotating the pages on the scanner so the pictures ended up
being square in my PNG and not needing rotation in Gimp (although other,
minor editing was still necessary).

Regards,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil@pricom.com.au

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
↑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