Post Reply 

Excessive compression in exported files?

Aug 13, 2014, 00:24 (This post was last modified: Aug 13, 2014 00:46 by LiamRowan.)
Post: #1
Excessive compression in exported files?
I have an image that is a 3.44mb png file. When I open this image as a layer on top of a second layer (17kb) and export as a JPEG with 100 as the quality setting (either optimized or not optimized) the resulting export image is approximately 250kb. That's about a 14/1 compression and too small for my purposes. If I open the 3.44mb png file BY ITSELF and export to a JPEG using the same settings the resulting export image is 2.02mb! That's plenty big for my need. I can't figure out why the 2-layer file compresses so much more than the top image when exported by itself. What I'd like to have is the 2-layer version export to that 2mb range, but with quality already set at 100, I don't know what else I can do. Seems like it has to be possible since the single 3.44mb image compresses into that size.

In addition to a solution, I'm certainly like to understand the reason WHY a 3.44mb image compresses to a 2.02 JPEG but the same image on top of another layer compresses so much more.

Any help would be greatly appreciated.

William

PS. I am attaching the 2-layer file as requested. I can see that this file may already answer part of my question. The xcf file is only 554kb, so compression appears to have already taken place. When I import the sunflower image (3.44mb) I have to scale the layer to make it fit. Could it be that scaling the image down compresses it before I export?


Attached File(s)
.xcf  Sunflower 2-layers.xcf (Size: 554.35 KB / Downloads: 17)
Find all posts by this user
Quote this message in a reply
Aug 13, 2014, 00:35
Post: #2
RE: Excessive compression in exported files?
Would you attach your.xcf with the layers in question so further tests can be carried out...
Find all posts by this user
Quote this message in a reply
Aug 13, 2014, 00:48
Post: #3
RE: Excessive compression in exported files?
(Aug 13, 2014 00:35)fluffybunny2 Wrote:  Would you attach your.xcf with the layers in question so further tests can be carried out...

Thanks for looking. I have attached the file; please see the PS I added to the original post for an additional (big) hint.

Wm
Find all posts by this user
Quote this message in a reply
Aug 13, 2014, 01:48
Post: #4
RE: Excessive compression in exported files?
Hi Liam,

In a way, scaling can compress the image, but what it's really doing is shrinking or eliminating pixels. When you scale down, you're losing color/quality information in the image.

So if you try to upscale / make image bigger, it will become blurry or pixelated.

An .xcf is an uncompressed* format, your layers & photos are original in this state.

As soon as you export to an image format like .jpeg, Gimp will flatten (merge) all the layers together.

Not quite sure about .PNG, but I assume similar merging.

.JPEG is a format used to save on bandwith, so even at 100, your going from a High quality format(.PNG) to a medium-high/compressed format (.JPEG) compression is likely.

If you have any transparency in your layers (grey checkered squares), you can opt in or out of it when exporting to .PNG.

.JPEG does not support transparency.

Lastly,
Quote:When I open this image as a layer on top of a second layer (17kb) and export as a JPEG with 100 as the quality setting (either optimized or not optimized) the resulting export image is approximately 250kb. That's about a 14/1 compression and too small for my purposes.

The megabytes(MB) in the image is how much space the file/image takes up on your computer's harddrive, not the resolution/quality of the image.
Unless you have room to spare on your drive(or have an external HD) less is more Smile

"In order to succeed, your desire for success should be greater than fear of failure." BC
[Image: 29uocaf.png]
iFS007 tut vids on YT ~ auto color B&W landscape tut
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 13, 2014, 08:31
Post: #5
RE: Excessive compression in exported files?
I recall one of the compression experts Nicolas Robidoux wrote that there was nothing gained at saving at 100% jpeg.

This graph shows the sort of fall off you get file size v quality http://i.imgur.com/gTY3iTp.png

Considerable difference in size between 90% (Gimp 2.8 default) and 100%

Using the image provided and saving at different percentages

340K comp.png > the original xcf saved as a png
but saved as a jpeg the fall off is dramatic
255K comp100.jpg
72K comp90.jpg
57K comp85.jpg

The other thing that comes to play and I have noticed this with screenshots is large blocks of solid colour.

so this png is the same size as the xcf posted 720x576 (that is PAL DVD frame size - making a video ?)

http://i.imgur.com/hqP6yWv.png and the size is 16K

Resaving as a 100% jpg size is 36K - larger than the png
then a 90% jpeg = 18K
and at 85% jpeg = 16K only now back to the png size.

I suspect it is all to do with that large block of single colour.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Aug 13, 2014, 21:23
Post: #6
RE: Excessive compression in exported files?
Thank you all for these great explanations. Further testing confirmed that the process of sizing the png file to the smaller layer did indeed cause substantial compression before I even exported, causing the export JPEG to be much smaller than expected. Really appreciate these insights; I was getting very, very frustrated. Wm
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Ram Usage seems excessive artmiller 5 360 May 27, 2017 16:24
Last Post: ofnuts
  Local help files 2.8.14 caz 5 411 Aug 30, 2014 16:59
Last Post: caz
  Gimp doesn't read back own files wouter@squirrel-systems.com 1 418 Jul 13, 2014 16:55
Last Post: rich2005
  empty files:( Shelbs 6 722 May 15, 2014 17:50
Last Post: Shelbs
  gimp 2.8.6 very slow to open files millsware 18 2,546 Feb 3, 2014 01:23
Last Post: iForStyle007

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS