Re: [Gimp-user] JPG file size increases with saving

2010-01-31 Thread Sven Neumann
On Mon, 2010-01-18 at 10:40 +0100, yahvuu wrote:
 Philip Rhoades wrote:
  It still seems counter intuitive that opening a JPG (even if it is a 
  photo rather than a computer generated image) and immediately saving it 
  with 100% quality increases the size by 2.5 . .

That is only non-intuitive because you are making the wrong assumption
that the JPEG quality was measured in percent. It isn't, it's just a
quality level that happens to have a range of 0 to 100. I suggest that
you read the JPEG FAQ, in particular the answer to question 5:

 http://www.faqs.org/faqs/jpeg-faq/part1/


Sven


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


Re: [Gimp-user] JPG file size increases with saving

2010-01-19 Thread yahvuu
Frank Gore wrote:
 But a much better and simpler idea is to just use a
 number range from 1..13, similar to photoshop.

 I'll take that over to the developer's list.
 
 I disagree, I think Photoshop's way of displaying the JPG compression
 slider is ridiculous. You can move the slider back and forth within a
 very wide range before the corresponding number changes. And since the
 slider doesn't spring back to a pre-determined spot on the line, that
 means one could select a different grade of level 8 depending on
 where the slider is positioned. You can actually see this by looking
 at the file size. If I select the lower range of level 8, the file
 is smaller than if I pick the higher range of level 8.

I fully agree that this is bad design.
If there are interstages of say, 8.0  8.25  8.5 and 8.75,
those clearly have to be displayed.


regards,
peter

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-19 Thread yahvuu
Norman Silverstone wrote:
 Here is a table that provides an approximate mapping between Photoshop
 quality levels and GIMP (actually IJG JPEG library) quality levels:
 
 Adobe Photoshop quality 12  =  GIMP quality 98, subsampling 1x1
[..]

wow, i grossly underestimated the influence of the advanced parameters:
Subsampling 1x1 ist even more important than the quality slider for
images with sharp edges..

In the meantime, i stumbled across a blog entry which also compares
Photoshop's 'save to web' results:
http://blogs.gnome.org/raphael/2007/10/23/mapping-jpeg-compression-levels-between-adobe-photoshop-and-gimp-24/


regards,
peter

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-19 Thread Claus Cyrny

yahvuu wrote:

Norman Silverstone wrote:
  

Here is a table that provides an approximate mapping between Photoshop
quality levels and GIMP (actually IJG JPEG library) quality levels:

Adobe Photoshop quality 12  =  GIMP quality 98, subsampling 1x1



Sure; subsampling takes groups of 4 x 4 pixels and averages the values
for hue/lightness for 2 x 2 pixels, or all four pixels respectively.

4 x 4 x 4 retains the original data, 4 x 2 x 2 averages for two groups
of 2 pixels each, and 4 x 1 x 1 assigns the same value to all four pixels in
the group , which results in a smaller file, but loss of quality at the same
time. (That's at least how I understood it.)

4 x 4 x 4:  4 x 2 x 2:4 x 1 x 1:
-  - -
|   |   |  |   |   | |   |
-  |   |   | |   |
|   |   |  |   |   | |   |
-  - -

Then there' s also the DCT value (Discrete Cosinus Transformation; the
algorithm used in JPEG; I think JPG 2000 uses a Discrete Wavelet
Transformation instead, which results in better quality - less JPG
artifacts). I have set this option to 'Fast Integer'; 'Floating Point' 
results

AFAIK in additional loss of information.

Claus

--
- Facebook http://www.facebook.com/claus.cyrny
- Flickr http://www.flickr.com/photos/claus_01/
- Twitter http://twitter.com/claus_01/
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-18 Thread yahvuu
Philip Rhoades wrote:
 It still seems counter intuitive that opening a JPG (even if it is a 
 photo rather than a computer generated image) and immediately saving it 
 with 100% quality increases the size by 2.5 . .

so you mean the scale should be different? Like

1 .. 10 ... 100 ... 10
 ^ ^
 |  \ extravagant luxury quality for the filthy rich
current 90
 default


i'm not shure if that would not create even more confusion...

regards,
peter


PS: as Michael Schumacher previously noted, the quality value
is indeed just a number, not a percentage.

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-18 Thread Philip Rhoades
Peter,


On 2010-01-18 20:40, yahvuu wrote:
 Philip Rhoades wrote:
 It still seems counter intuitive that opening a JPG (even if it is a
 photo rather than a computer generated image) and immediately saving it
 with 100% quality increases the size by 2.5 . .

 so you mean the scale should be different? Like

 1 .. 10 ... 100 ... 10
   ^ ^
   |  \ extravagant luxury quality for the filthy rich
  current 90
   default


?? - that's an odd comment . .


 i'm not shure if that would not create even more confusion...


I think an average user would expect a saved file with a quality of 
100% to be the same as the original file ie the same specs and file size . .


 PS: as Michael Schumacher previously noted, the quality value
  is indeed just a number, not a percentage.


Yes, but misleading . .

Regards,

Phil.
-- 
Philip Rhoades

GPO Box 3411
Sydney NSW  2001
Australia
E-mail:  p...@pricom.com.au
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-18 Thread yahvuu
Philip Rhoades wrote:
 Peter,
 
 
 On 2010-01-18 20:40, yahvuu wrote:
 Philip Rhoades wrote:
 It still seems counter intuitive that opening a JPG (even if it is a
 photo rather than a computer generated image) and immediately saving it
 with 100% quality increases the size by 2.5 . .

 so you mean the scale should be different? Like

 1 .. 10 ... 100 ... 10
   ^ ^
   |  \ extravagant luxury quality for the filthy rich
  current 90
   default
 
 
 ?? - that's an odd comment . .

oh yeah, i should have been more clear.
Now that you and me and probably a few others have learned something new
about JPG peculiarities, i was brainstorming how the user interface could
be tweaked to avoid misleading associations.

Above diagram was intended to depict a logarithmic scale for the quality value,
where the numbers relate to the typical growth in file size [1].

But a much better and simpler idea is to just use a
number range from 1..13, similar to photoshop.

I'll take that over to the developer's list.

regards,
peter



[1] http://en.wikipedia.org/wiki/File:Quality_comparison_jpg_vs_saveforweb.jpg

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-18 Thread Claus Cyrny

Philip Rhoades wrote:

Cristi,


On 2010-01-16 06:55, Cristian Secară wrote:
  

On Fri, 15 Jan 2010 21:56:40 +1100, Philip Rhoades wrote:



- When saving as JPG with 85% quality am I losing information?
  

Yes, but still with the same 85% quality you may obtain different
results by changing other parameters.

Just look at the following example. Note the file size for each, but
most of all, look at the color quality and the outline of objects
(the files are quite small; save them somewhere and look at them by
switching forth and back so you can notice the differences).
The JPEG were both saved with 85%, but one with subsample for best
quality and the other with subsample for minimum file size:

http://www.secarica.ro/misc/monopoly.bmp
http://www.secarica.ro/misc/monopoly.png
http://www.secarica.ro/misc/monopoly_gimp_hi_quality.jpg
http://www.secarica.ro/misc/monopoly_gimp_minim_size.jpg

Take the .bmp and do further tests with the save options.




Yep, the only one where I could see a difference was with the last one.

It still seems counter intuitive that opening a JPG (even if it is a 
photo rather than a computer generated image) and immediately saving it 
with 100% quality increases the size by 2.5 . 
  


The exampe image is actually not well-suited for JPG. For this one,
indexed PNG would work much better. Som, this comparisonis actually
misleading. It would actually be better use a photo for this.

When I was still using Windows (I'm under Ubuntu Karmic now), I used
Ulead's SmartSaver, where one can view the original  the optimized image
at the same time and tweak the settings until one is satisfied with the 
result.


I usually have compression set to '90%'. Due to quality reasons, I never go
below that. Additionally, for DCT (Discrete Cosinus Transformation), I am
using 'Fast Integer', not 'Floating Point' (further loss, AFAIK). ('DCT' 
is part

of the JPG compression process, which works in several steps.)

Claus

--
- Facebook http://www.facebook.com/claus.cyrny
- Flickr http://www.flickr.com/photos/claus_01/
- Twitter http://twitter.com/claus_01/
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-18 Thread Norman Silverstone
 snip 

 But a much better and simpler idea is to just use a
 number range from 1..13, similar to photoshop.
 
 I'll take that over to the developer's list.

Is this any help, I came across it a long time ago?

Here is a table that provides an approximate mapping between Photoshop
quality levels and GIMP (actually IJG JPEG library) quality levels:

Adobe Photoshop quality 12  =  GIMP quality 98, subsampling 1x1
Adobe Photoshop quality 11  =  GIMP quality 95, subsampling 1x1
Adobe Photoshop quality 10  =  GIMP quality 93, subsampling 1x1
Adobe Photoshop quality 9   =  GIMP quality 91, subsampling 1x1
Adobe Photoshop quality 8   =  GIMP quality 90, subsampling 1x1
Adobe Photoshop quality 7   =  GIMP quality 89, subsampling 1x1
Adobe Photoshop quality 6   =  GIMP quality 90, subsampling 2x2
Adobe Photoshop quality 5   =  GIMP quality 89, subsampling 2x2
Adobe Photoshop quality 4   =  GIMP quality 88, subsampling 2x2
Adobe Photoshop quality 3   =  GIMP quality 88, subsampling 2x2
Adobe Photoshop quality 2   =  GIMP quality 87, subsampling 2x2
Adobe Photoshop quality 1   =  GIMP quality 86, subsampling 2x2
Adobe Photoshop quality 0   =  GIMP quality 85, subsampling 2x2

Norman

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-18 Thread Frank Gore
 But a much better and simpler idea is to just use a
 number range from 1..13, similar to photoshop.

 I'll take that over to the developer's list.

I disagree, I think Photoshop's way of displaying the JPG compression
slider is ridiculous. You can move the slider back and forth within a
very wide range before the corresponding number changes. And since the
slider doesn't spring back to a pre-determined spot on the line, that
means one could select a different grade of level 8 depending on
where the slider is positioned. You can actually see this by looking
at the file size. If I select the lower range of level 8, the file
is smaller than if I pick the higher range of level 8. This has
always bugged me since the dawn of Photoshop (I started using it at
version 4.0 back in 1997). I far prefer the Gimp method of displaying
this setting.

 Is this any help, I came across it a long time ago?

 Here is a table that provides an approximate mapping between Photoshop
 quality levels and GIMP (actually IJG JPEG library) quality levels:

Now that's awesome. I always wondered what the correlation was. And I
always worried that Adobe was ignoring the subsampling aspect, now I
know better. It's also interesting to see that they don't allow
anything lower than 8...@2x2.

-- 
Frank Gore
Project Manager
www.projectpontiac.com
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-17 Thread Marco Ciampa
On Fri, Jan 15, 2010 at 09:56:40PM +1100, Philip Rhoades wrote:
 People,
I found this thread about jpeg very interesting indeed. For this 
I thank you all, who asked and who have used his/her spare time to
enlight the audience.
I even think that this thread could be posted in a FAQ/wiki/manual 
since IMHO is a topic that many have often wondered about.

bye

-- 


Marco Ciampa

++
| Linux User  #78271 |
| FSFE fellow   #364 |
++
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-17 Thread Philip Rhoades
Cristi,


On 2010-01-16 06:55, Cristian Secară wrote:
 On Fri, 15 Jan 2010 21:56:40 +1100, Philip Rhoades wrote:

 - When saving as JPG with 85% quality am I losing information?

 Yes, but still with the same 85% quality you may obtain different
 results by changing other parameters.

 Just look at the following example. Note the file size for each, but
 most of all, look at the color quality and the outline of objects
 (the files are quite small; save them somewhere and look at them by
 switching forth and back so you can notice the differences).
 The JPEG were both saved with 85%, but one with subsample for best
 quality and the other with subsample for minimum file size:

 http://www.secarica.ro/misc/monopoly.bmp
 http://www.secarica.ro/misc/monopoly.png
 http://www.secarica.ro/misc/monopoly_gimp_hi_quality.jpg
 http://www.secarica.ro/misc/monopoly_gimp_minim_size.jpg

 Take the .bmp and do further tests with the save options.


Yep, the only one where I could see a difference was with the last one.

It still seems counter intuitive that opening a JPG (even if it is a 
photo rather than a computer generated image) and immediately saving it 
with 100% quality increases the size by 2.5 . .

Thanks,

Phil.
-- 
Philip Rhoades

GPO Box 3411
Sydney NSW  2001
Australia
E-mail:  p...@pricom.com.au
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] JPG file size increases with saving

2010-01-15 Thread Philip Rhoades
People,

I am trying to work out why there is such a large file increase when I 
edit a file and save it.  The background info:

Original file (from digital camera) - format, size, depth, geom:

JPEG   680590   8 2048x1536

After opening and saving original file with defaults (85% quality):

JPEG   646554   8 2048x1536

After opening and saving original file with defaults but with 100% quality:

JPEG   1618121   8 2048x1536

After opening, cropping and saving original file as a PNG file with 
defaults (compression 9):

PNG   4722953   8 2048x1536

After opening, cropping and saving original file with defaults but with 
100% quality:

JPEG   1631911   8 1590x1332

Questions:

- When saving as JPG with 85% quality am I losing information?

- How can saving as JPG with 100% quality increase information (file size)?

- Why is PNG so inefficient?

- imageinfo doesn't seem to be able to indicate information structure 
/compression information differences between the files - is there some 
way of doing this?

Thanks,

Phil.
-- 
Philip Rhoades

GPO Box 3411
Sydney NSW  2001
Australia
E-mail:  p...@pricom.com.au
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Greg Chapman
Hi Philip,

On 15 Jan 10 10:56 Philip Rhoades p...@pricom.com.au said:
 - When saving as JPG with 85% quality am I losing information?

Yes!
 
 - How can saving as JPG with 100% quality increase information (file
 size)?

It doesn't throw so much info away. It's not actually bigger than the 
the raw data (i.e. total pixels x colour depth)  Try saving the image 
as a BMP to get an indication of that.
 
 - Why is PNG so inefficient?

It's a lossless format (i.e. unlke JPG it doesn't throw any 
information away). It's not so much inefficient, rather it just 
saves ALL the data.
 
 - imageinfo doesn't seem to be able to indicate information 
 structure /compression information differences between the files - 
 is there some way of doing this?

Not in any simple way. You're assumed to know the general benefits of 
the various file types for different purposes. There is some 
information in GIMP help. Best you read up some fuller descriptions of
the various image file formats. I'm sure someone be be along in a 
moment with some appropriate links.

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread yahvuu
Hi Philip,


Philip Rhoades wrote:
 - When saving as JPG with 85% quality am I losing information?

JPG utilizes lossy compression, which means you'll loose information
every time you save as JPG, even at 100% quality setting.

That value does not specify the percentage of information stored
in the JPG. It is just a number which allows to choose a trade-off
between subjective image quality and file size.

In consequence, the workflow recommendation is to routinely save as XCF
and only create a JPG when the (finished) work leaves your system.


 - How can saving as JPG with 100% quality increase information (file size)?

As said above, it is wrong to assume you were saving
100% of the 85% of the original image's information here.

In practice, one has to look at the compression artifacts to
be able to adjust for minimum file size at acceptable quality.
There's no way to just rely on the numbers.


What happens in detail:

when opening the JPG it gets decompressed to 2048x1536 RGB pixels of 3 bytes
each, a whopping total of 9437184 bytes of RAM. (This holds true for any
color JPG of 2048x1536 size, regardless of file size).

Now when saving this image as JPG, it's these 9437184 byte of image that
get compressed, regardless from where this data originated.

Compressing an image of 9437184 bytes at 100% gives a larger file
size  than compressing the same image at 85%. There's no memory of
previously used compression rates.

And regardless of file size, each new JPG compression step adds new artifacts
to the image, degrading quality.


 - Why is PNG so inefficient?

PNG offers lossless compression and isn't designed for use with photos.
It excels at graphic data which e.g. has uniform color areas.


regards,
peter

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Philip Rhoades
People,


On 2010-01-15 23:33, yahvuu wrote:
 Hi Philip,


 Philip Rhoades wrote:
 - When saving as JPG with 85% quality am I losing information?

 JPG utilizes lossy compression, which means you'll loose information
 every time you save as JPG, even at 100% quality setting.

 That value does not specify the percentage of information stored
 in the JPG. It is just a number which allows to choose a trade-off
 between subjective image quality and file size.

 In consequence, the workflow recommendation is to routinely save as XCF
 and only create a JPG when the (finished) work leaves your system.


 - How can saving as JPG with 100% quality increase information (file size)?

 As said above, it is wrong to assume you were saving
 100% of the 85% of the original image's information here.

 In practice, one has to look at the compression artifacts to
 be able to adjust for minimum file size at acceptable quality.
 There's no way to just rely on the numbers.


 What happens in detail:

 when opening the JPG it gets decompressed to 2048x1536 RGB pixels of 3 bytes
 each, a whopping total of 9437184 bytes of RAM. (This holds true for any
 color JPG of 2048x1536 size, regardless of file size).

 Now when saving this image as JPG, it's these 9437184 byte of image that
 get compressed, regardless from where this data originated.

 Compressing an image of 9437184 bytes at 100% gives a larger file
 size  than compressing the same image at 85%. There's no memory of
 previously used compression rates.

 And regardless of file size, each new JPG compression step adds new artifacts
 to the image, degrading quality.


Firstly, thanks for the replies!

What still doesn't make sense is that if the original file is JPG and 
one simply opens it and then saves it as another JPG file with 100% 
quality - you are saying that introduced artifacts are adding about 150% 
to the file size? (681 KB to 1.618 MB) How could the compression 
algorithms be so different as to cause this sort of result?  - At worst 
I would have expected maybe a 10% increase in size . .

Thanks,

Phil.
-- 
Philip Rhoades

GPO Box 3411
Sydney NSW  2001
Australia
E-mail:  p...@pricom.com.au
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread yahvuu
Philip Rhoades wrote:
 What still doesn't make sense is that if the original file is JPG and
 one simply opens it and then saves it as another JPG file with 100%
 quality - you are saying that introduced artifacts are adding about 150%
 to the file size? (681 KB to 1.618 MB) How could the compression
 algorithms be so different as to cause this sort of result?  - At worst
 I would have expected maybe a 10% increase in size . .

well firstly, 1.6MB are not that bad in comparison to 9MB of raw RGB data, 
right?
(just try saving to uncompressed BMP as Greg suggested).

Btw, 100% quality for JPG gives very little visible advantage over the
default 90% setting.

The relationship between quality value, file size and perceived image quality
is very delicate. Any assertion has to be made with a lot of weasel words.
So yes, compression artifacts have a tendency to hinder compression,
resulting in larger file sizes after re-compression to comparable quality.
A similar effect is caused by noise. So to get optimal JPG files, it's
best to use a RAW-XCF-JPG workflow where the JPG is created only once.

Just have a look at the advanced settings in the JPG save dialog to get
a first impression of what machinery is at work here. There also was a
very long thread on gimp.developer on that very quality setting...


How does image quality compare if you adjust the quality slider
such that the resulting file size is about 680KB?


regards,
peter

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Cristian Secară
On Fri, 15 Jan 2010 21:56:40 +1100, Philip Rhoades wrote:

 - Why is PNG so inefficient?

PNG is not efficient for real life images (ordinary photos).
PNG is very efficient for computer generated images (like a snaphot of
a program window, or a relatively simple paint, or vector graphics, or
some CAD drawing export), where large areas use exactly the same pixel
value from one pixel to the other.

Cristi

-- 
Cristian Secară
http://www.secarica.ro/
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Greg Chapman
Hi Philip,

On 15 Jan 10 12:53 Philip Rhoades p...@pricom.com.au said:
 What still doesn't make sense is that if the original file is JPG 
 and one simply opens it and then saves it as another JPG file with 
 100% quality - you are saying that introduced artifacts are adding 
 about 150% to the file size? (681 KB to 1.618 MB)

The %age, isn't one of straight file size reduction, but relates to 
the areas of the image to be averaged. The the more you reduce the 
quality the more you increase the potential for larger areas to be 
averaged. A busy image will not suffer much averaging regardless of 
the compression requested, but one with large areas of broadly similar
colour, sky, painted walls, car bodywork, etc will have progressively 
larger areas averaged the more you reduce quality and the file size 
will reduce accordingly.

Some images, for example, where there is a load of tumbling water and 
spray will barely reduce in size t all even at higher compression 
levels as no part of the image has a large enough plain area to allow 
it to be averaged.

 How could the compression algorithms be so different as to cause 
 this sort of result?  - At worst I would have expected maybe a 10% 
 increase in size . .

I think you are assuming the whole imaged is compressed equally, 
regardless of the level of detail and colour change from one pixel to 
the next. Only in images with large areas of similar colour will the 
fle size reduce much at higher compression levels. The control is more
one of reduce this if you can, rather than reduce it whatever the 
consequenses.

Greg Chapman
http://www.gregtutor.plus.com
Helping new users of KompoZer and The GIMP
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Paul Hartman
On Fri, Jan 15, 2010 at 4:56 AM, Philip Rhoades p...@pricom.com.au wrote:
 People,

 I am trying to work out why there is such a large file increase when I
 edit a file and save it.  The background info:

Google the difference between lossy and lossless image
compression. Once you understand the fundamental differences your
question will be answered (actually, it will be a non-question) :)
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Akkana Peck
Philip Rhoades writes:
 What still doesn't make sense is that if the original file is JPG and 
 one simply opens it and then saves it as another JPG file with 100% 

Because JPEG isn't meant to be saved at 100% quality.

The JPEG FAQ, http://www.faqs.org/faqs/jpeg-faq/part1/section-5.html, says:

  Except for experimental purposes, never go above about Q 95; using Q 100
  will produce a file two or three times as large as Q 95, but of hardly any
  better quality.  Q 100 is a mathematical limit rather than a useful setting.
  If you see a file made with Q 100, it's a pretty sure sign that the maker
  didn't know what he/she was doing.

Do a web search on
  jpeg quality 100%
and you'll find lots of detailed discussions of this.

GIMP's Show preview in image window check box is extremely
helpful, and lets you see the trade-off in quality versus size.
It's too bad it's not enabled by default.

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Greg Chapman
Hi Philip,

On 15 Jan 10 18:27 Philip Rhoades p...@pricom.com.au said:
 - when the JPG is uncompressed by GIMP into RAM, there is no loss of
 information (?)

No further loss, but the restored image is subject to those averages 
created when the image was originally compressed.
 
 - when GIMP then saves the same image as a new JPG at 100% quality 
 (I would have thought that this meant not losing any more 
 information),

You shouldn't take 100% too literally. Think of it more as best 
quality, but the best that the JPG algorithm achieves is not no 
change.

 that the second JPG would be compressed/created in much the same way
 as the first and therefore would be about the same size . .

Remember that it is working on data that is already corrupted so it 
further corrupts it, again averaging the larger areas of similar 
colour. If you didn't want it to compress it a bit (even at 100% 
quality) you wouldn't be using selecting a JPG format when saving it 
would you? You'd choose a lossless format instead.
 
 of course I have no control over the file format that the camera 
 uses

Most cameras do have a range of compression options available within 
their menu system. It won't have the variability of the GIMP but 
probably will have a Normal setting plus a high and low option.

 and cropping a camera image and actually getting a result that is 
 2.5 times the size of the original is a bit annoying . .

But now you realise how much the data is compressed at even normal 
levels, you realise how good the algorithm was that the JPEG came up 
with! :-)

Greg Chapman
http://www.gregtutor.plus.com
Helping new users of KompoZer and The GIMP
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Paul Hartman
On Fri, Jan 15, 2010 at 12:27 PM, Philip Rhoades p...@pricom.com.au wrote:
 - there was a loss of information when the first JPG was saved in the
 digital camera memory from the CCD

Correct

 - when the JPG is uncompressed by GIMP into RAM, there is no loss of
 information (?)

Since JPG is not lossless, there is always a loss of information. Or
more specifically the same JPG can be interpreted differently by
different software, so opening it in GIMP might look different than
another program perhaps. Once an image is saved as JPG there's no way
to get the original image back from that JPG file.

 - when GIMP then saves the same image as a new JPG at 100% quality (I
 would have thought that this meant not losing any more information),
 that the second JPG would be compressed/created in much the same way as
 the first and therefore would be about the same size . .

100% quality does not mean no loss of info, just means that it's as
close to the original as JPG is capable of getting. It's still not
going to be identical to the original.

 Good to know that this happens anyhow . . of course I have no control
 over the file format that the camera uses and cropping a camera image
 and actually getting a result that is 2.5 times the size of the original
 is a bit annoying . .

That's why the expensive/professeional cameras output in raw format,
so the photographer can have total control. :) FWIW, if you have a
Canon you very well might be able to install CHDK and get raw images,
that's what I've done with my SD550 and SD1000.

Depending on your purpose for the final JPG file, there are other ways
to make the file smaller. Saving as progressive vs baseline usually
makes a small difference in size. You can use the program jpegoptim to
optimize (losslessly) and reduce filesize, and you can strip out
EXIF/thumbnail/etc header info to make the file smaller without
affecting the actual image data either (assuming you're not using the
EXIF for rotation/etc in whatever program you're displaying the image
in).

For best quality/size trade-off when you save your JPG in GIMP I would
use the show preview in window (something like that) option which
will show the resulting compressed JPEG in a window. Then you can
adjust the quality and other settings and see how it looks. I usually
adjust it as low as I can until the image appears to degrade, then I
bump it up a notch and choose that. For me, around 75% seems to be a
pretty good combination of small file size and good quality.

There are also JPEG tools that allow you to losslessly crop/rotate etc
your pictures. Check out jpegtran from jpegclub.org or one of these
programs which supposedly include the same functionality:
http://jpegclub.org/losslessapps.html
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Sven Neumann
Hi,

On Sat, 2010-01-16 at 05:27 +1100, Philip Rhoades wrote:

 I guess what is confusing is this:
 
 - there was a loss of information when the first JPG was saved in the 
 digital camera memory from the CCD
 
 - when the JPG is uncompressed by GIMP into RAM, there is no loss of 
 information (?)
 
 - when GIMP then saves the same image as a new JPG at 100% quality (I 
 would have thought that this meant not losing any more information), 
 that the second JPG would be compressed/created in much the same way as 
 the first and therefore would be about the same size . .

Actually, you get almost no further degradation if you save the image
again with the same settings that were used for the first save. The JPEG
plug-in even stores information in the image when the image is opened
and it will use that information to save it in the best possible way
when you save it again. Just leave all controls at their default values.

Note that I said almost. Of course the image will suffer a little. But
you won't get significantly better results if you increase the JPEG
quality or change other settings in the save dialog. You just get a
larger file.


Sven


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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Bob Meetin
Actually, you get almost no further degradation if you save the image
 again with the same settings that were used for the first save. The JPEG
 plug-in even stores information in the image when the image is opened
 and it will use that information to save it in the best possible way
 when you save it again. Just leave all controls at their default values.

 Note that I said almost. Of course the image will suffer a little. But
 you won't get significantly better results if you increase the JPEG
 quality or change other settings in the save dialog. You just get a
 larger file.


 Sven
Quality is relative to what you need, how the image is used as well. If 
it's for internet use, 70% or so is reasonable quality. Image weight 
adds up fast if you have a lot of large images. I don't do print media 
so someone else would need to talk to it, but I commonly here that 
300-600 dpi is requested whereas for the internet resolution is much 
less of a factor.

If all I've been given is a .jpg I'll typically save it as a .png along 
the way.

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Cristian Secară
On Fri, 15 Jan 2010 21:56:40 +1100, Philip Rhoades wrote:

 - When saving as JPG with 85% quality am I losing information?

Yes, but still with the same 85% quality you may obtain different
results by changing other parameters.

Just look at the following example. Note the file size for each, but
most of all, look at the color quality and the outline of objects
(the files are quite small; save them somewhere and look at them by
switching forth and back so you can notice the differences).
The JPEG were both saved with 85%, but one with subsample for best
quality and the other with subsample for minimum file size:

http://www.secarica.ro/misc/monopoly.bmp
http://www.secarica.ro/misc/monopoly.png
http://www.secarica.ro/misc/monopoly_gimp_hi_quality.jpg
http://www.secarica.ro/misc/monopoly_gimp_minim_size.jpg

Take the .bmp and do further tests with the save options.

Cristi

-- 
Cristian Secară
http://www.secarica.ro/
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Michael Schumacher
On 15.01.2010 19:59, Greg Chapman wrote:

 - when GIMP then saves the same image as a new JPG at 100% quality 
 (I would have thought that this meant not losing any more 
 information),
 
 You shouldn't take 100% too literally.

Especially if the value is not a percentage.


Regards,
Michael

-- 
GIMP  http://www.gimp.org  | IRC: irc://irc.gimp.org/gimp
Wiki  http://wiki.gimp.org | .de: http://gimpforum.de
Plug-ins  http://registry.gimp.org |
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread David Hodson
On Fri, 2010-01-15 at 13:32 -0600, Paul Hartman wrote:
 On Fri, Jan 15, 2010 at 12:27 PM, Philip Rhoades p...@pricom.com.au wrote:

  - when the JPG is uncompressed by GIMP into RAM, there is no loss of
  information (?)
 
 Since JPG is not lossless, there is always a loss of information. Or
 more specifically the same JPG can be interpreted differently by
 different software, so opening it in GIMP might look different than
 another program perhaps.

I'm fairly sure this is not true - there is only one way to uncompress a
JPG file, so all programs should create the same uncompressed version.

-- David


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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Jernej Simončič
On Sat, 16 Jan 2010 10:54:23 +1100, David Hodson wrote:

 I'm fairly sure this is not true - there is only one way to uncompress a
 JPG file, so all programs should create the same uncompressed version.

Not true - I know that at least different versions of ImageMagick will
decompress the same JPEG slightly differently, probably due to different
rounding.

-- 
 Jernej Simončič  http://eternallybored.org/ 

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Paul Hartman
On Fri, Jan 15, 2010 at 5:54 PM, David Hodson hods...@ozemail.com.au wrote:
 On Fri, 2010-01-15 at 13:32 -0600, Paul Hartman wrote:
 On Fri, Jan 15, 2010 at 12:27 PM, Philip Rhoades p...@pricom.com.au wrote:

  - when the JPG is uncompressed by GIMP into RAM, there is no loss of
  information (?)

 Since JPG is not lossless, there is always a loss of information. Or
 more specifically the same JPG can be interpreted differently by
 different software, so opening it in GIMP might look different than
 another program perhaps.

 I'm fairly sure this is not true - there is only one way to uncompress a
 JPG file, so all programs should create the same uncompressed version.

From an old JPEG FAQ:

Another important aspect of JPEG is that decoders can trade off
decoding speed against image quality, by using fast but inaccurate
approximations to the required calculations.  Some viewers obtain
remarkable speedups in this way.  (Encoders can also trade accuracy
for speed, but there's usually less reason to make such a sacrifice
when writing a file.)

Also, of course, things like color management and other kinds of
post-processing can cause differences when the same file is opened in
different programs.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Bob Long
Philip Rhoades wrote:

 I am trying to work out why there is such a large file increase when I 
 edit a file and save it.  The background info:
 
 Original file (from digital camera) - format, size, depth, geom:
 
 JPEG   680590   8 2048x1536

[..]

 After opening, cropping and saving original file as a PNG file with 
 defaults (compression 9):
 
 PNG   4722953   8 2048x1536

There's something funny there. If the image has been cropped, how can it 
be the same dimensions as the original (2048x1536) (unless you have then 
done a resize you didn't mention)?

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


Re: [Gimp-user] JPG file size increases with saving

2010-01-15 Thread Philip Rhoades
Bob,


On 2010-01-16 11:32, Bob Long wrote:
 Philip Rhoades wrote:

 I am trying to work out why there is such a large file increase when I
 edit a file and save it.  The background info:

 Original file (from digital camera) - format, size, depth, geom:

 JPEG   680590   8 2048x1536

 [..]

 After opening, cropping and saving original file as a PNG file with
 defaults (compression 9):

 PNG   4722953   8 2048x1536

 There's something funny there. If the image has been cropped, how can it
 be the same dimensions as the original (2048x1536) (unless you have then
 done a resize you didn't mention)?


Sorry, copy and paste error on the description - the PNG was not cropped . .

Regards,

Phil.
-- 
Philip Rhoades

GPO Box 3411
Sydney NSW  2001
Australia
E-mail:  p...@pricom.com.au
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user