8

Thank you in advance for your help. I am a fairly new GIMP user with no Photoshop experience, so bear with me.

A batch of 600 images was ruined by something inside the camera that caused a smudge to appear in the left corner of every photo. I found a blog post about how to use GIMP's healing tool and successfully blotted out the smudge on one of the images.

I did this using a layer so I can come back and do it differently if I learn a better method later.

When I save as XCF, the file size jumped to 23.2 MB! WHAT? And if I choose the option to use better compression now available in GIMP 2.10, it is still 14.1 MB.

The original RAW JPEG is only 3.27 MB. I'm very conscious about my disk usage. Is there something I'm missing that can keep the original image quality but a more reasonable file size?

3 Answers 3

8

There is nothing wrong. What you are describing is completely normal, and to be expected. Since you are relatively new to this, your confusion is understandable. The reason this happens is not obvious.

To begin with, JPEGs are not RAW images. JPEG is a format which has lossy compression. RAW images are unprocessed images from a camera, such as NEF, CR2, or DNG formats. Don't confuse JPEGs that come out of your camera with RAW files. These are completely different things.

When you open a JPEG in a raster image editor such as GIMP or Photoshop the compressed image is expanded to full size - it's no longer a compressed JPEG.

When you save the file as XCF, ie GIMP's native file format, it is an uncompressed format, so the file size will be much bigger than a JPEG.

The same thing happens if you open a JPEG in Photoshop, and save as a PSD (ie Photoshop's native file format).

For example, I open this JPEG in Photoshop shown below. The file size is 109kb.

enter image description here

Opening in Photoshop, and saving as a PSD (Photoshop's native file format) the files size is 889kb - that's more than 8 times bigger.

enter image description here

When I do the same in GIMP with the same image, the XCF is 861kb.

enter image description here

Also note that if you add layers to the original image, the file size will get much bigger - essentially, each layer is a new image.

As for disk space - external hard drives are cheap. You can buy external 1TB hard drives for less than £50GBP/€56/US$65. Honestly, these days 23mb is not really a large image size. Some new professional cameras produce RAW files in excess of 40mb per image! I frequently retouch professional images, and it's not uncommon to end up with Photoshop PSD files that are 300mb!

To save disk space

You might not want to save XCF files if you don't need to edit the image again. You can export your image as a JPEG again - although it's not a particularly good idea to edit jpegs repeatedly, and save them again, because the quality will degrade slightly each time. However, in your case it probably won't make much difference, and won't be that noticeable. Don't overwrite your original JPEG files - keep these. Work on copies of your files. If you want to do the work again, you can edit your original JPEG files that you kept.

In GIMP, to export click File > Export As, choose JPEG as the file type - don't add too much compression or you will degrade the quality - keep the compression setting to no lower than 7 or 8.

Also note that XCF and PSD images are no good for the internet. They don't work in browsers.

3
  • That makes sense. Thank you for the very thoughtful reply!
    – HappyRoy
    Commented Jul 30, 2018 at 23:39
  • Don't you mean no higher than 7 or 8 ? The higher the setting the higher the compression and you mean to avoid such setting in JPEG format. So, you mean to keep it to 6 or below with 0 being no compression at all.
    – Alaster
    Commented May 30, 2020 at 0:36
  • @Alaster - No. You have it backwards. The higher the quality setting, the less compression. This is the same in Photoshop and GIMP.
    – Billy Kerr
    Commented Oct 23, 2021 at 23:46
1

TL;DR: "Menu → Layer → Crop to Content" is extremely helpful.

I've been working on a simple collage image for a classifieds site. The image is supposed to show an item from different angles.

Naturally, my GIMP project has individual images as Layers, cropped them and added a background.

My original images were approximately 8 MPix (~5 Mbytes) each. However, the project containing 7-8 images became a whopping 380-400 Mbytes!

I noticed that most of my layers were mostly blank, so I cropped each Layer to Content.
Surprisingly, the XCF file reduced to 80Mb after that.

1

For some use cases, I really wish there would be an option to use JPG compression for selected layers of a XCF file. For example, when I want to add the original image files of software documentation to a Git repository, I may have a case like this:

  • If I add the images as one JPG (800 kiB) and two PNGs for overlay markings (70 kiB each), I have 940 kiB in total.
  • If I add the images as layers in a single XCF file, I have 9.6 MiB in total, or 10 times as much.

For these cases, my solution is to save the images as follows:

  1. Make sure all layers are the same size as the image canvas.

  2. Save each layer into its own file by showing only that layer and then choosing "File → Export As…". Choose PNG format for layers that need transparency or lossless quality, and JPG format for photo layers.

Then, when I want to open the complete image again to work with it:

  1. Open GIMP, or close all images currently open in there.

  2. Click "File → Open as Layers…" and select the images you want to open.

  3. Sort the layers as needed. (I could not yet figure out the logic which image will appear in the top layer.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.