### 5.8. Export Image as JPEG

JPEG files usually have an extension .jpg, .JPG, or .jpeg. It is a very widely used format, because it compresses images very efficiently, while minimizing the loss of image quality. No other format comes close to achieving the same level of compression. It does not, however, support transparency or multiple layers.

Figure 15.64. The JPEG Export dialog

The JPEG algorithm is quite complex, and involves a bewildering number of options, whose meaning is beyond the scope of this documentation. Unless you are a JPEG expert, the Quality parameter is probably the only one you will need to adjust.

Quality

  When you save a file in JPEG format, a dialog is displayed that allows you to set the Quality level, which ranges from 0 to 100. Values above 95 are generally not useful, though. The default quality of 85 usually produces excellent results, but in many cases it is possible to set the quality substantially lower without noticeably degrading the image. You can test the effect of different quality settings by checking Show Preview in image window in the JPEG dialog.

  | Note
  Please note, that the numbers for the JPEG quality level have a different meaning in different applications. Saving with a quality level of 80 in GIMP is not necessarily comparable with saving with a quality level of 80 in a different application.

Use quality settings from original image

  If a particular quality setting (or “quantization table”) was attached to the image when it was loaded, then this option allows you to use them instead of the standard ones.

  If you have only made a few changes to the image, then re-using the same quality setting will give you almost the same quality and file size as the original image. This will minimize the losses caused by the quantization step, compared to what would happen if you used different quality setting.

  If the quality setting found in the original file are not better than your default quality settings, then the option “Use quality settings from original image” will be available but not enabled. This ensures that you always get at least the minimum quality specified in your defaults. If you did not make major changes to the image and you want to save it using the same quality as the original, then you can do it by enabling this option.

Show preview in image window

  Checking this option causes each change in quality (or any other JPEG parameter) to be shown in the image display. (This does not alter the image: the image reverts back to its original state when the JPEG dialog is closed.)

Advanced Options

  Some information about the advanced settings:

  Smoothing

    JPG compression creates artifacts. By using this option, you can smooth the image when saving, reducing them. But your image becomes somewhat blurred.

  Progressive

    With this option enabled, the image chunks are stored in the file in an order that allows progressive image refinement during a slow connection web download. The progressive option for JPG has the same purpose as the interlace option for GIF. Unfortunately, the progressive option produces slightly larger JPG files (than without the progressive option).

    | Note
    Beware that certain older TVs and photo frames (and maybe other devices) may not be able to show jpeg images that have been exported with the progressive setting enabled (which is the default).

  Export as CMYK

    Whether to export using a CMYK Color Profile.

  Use arithmetic coding

    Arithmetic encoding is a form of entropy encoding (a lossless data compression scheme) that can be used in exporting as JPEG. Images using arithmetic encoding can be 5 - 10 % smaller. But older software may have trouble opening these images.

  Optimize

    If you enable this option, the optimization of entropy encoding parameters will be used. The result is typically a smaller file, but it takes more time to generate.

  Use restart markers

    The image file can include markers which allow the image to be loaded as segments. If a connection is broken while loading the image in a web page, loading can resume from the next marker.

  Interval (MCU rows)

    JPEG images are stored as a series of compressed square tiles named MCU (Minimum Coding Unit). You can set the size of these tiles (in pixels).

  Subsampling

    The human eye is not sensitive in the same way over the entire color spectrum. The compression can use this to treat slightly different colors that the eye perceives as very close, as identical colors. Three methods are available:

    - 1x1,1x1,1x1 (best quality): Commonly referred to as (4:4:4), this produces the best quality, preserving borders and contrasting colors, but compression is less.

    - 2x1,1x1,1x1 (4:2:2): This is the standard subsampling, which usually provides a good ratio between image quality and file size. There are situations, however, in which using no subsampling (4:4:4) provides a noticeable increase in the image quality; for example, when the image contains fine details such as text over a uniform background, or images with almost-flat colors.

    - 1x2,1x1,1x1 This is similar to (2x1,1x1,1x1), but the chroma sampling is in the horizontal direction rather than the vertical direction; as if someone rotated an image.

    - 2x2,1x1,1x1 (smallest file): Commonly referred to as (4:1:1), this produces the smallest files. This suits images with weak borders but tends to denature colors.

  DCT Method

    DCT is “discrete cosine transform”, and it is the first step in the JPEG algorithm going from the spatial to the frequency domain. The choices are “float”, “integer” (the default), and “fast integer”.

    - float: The float method is very slightly more accurate than the integer method, but is much slower unless your machine has very fast floating-point hardware. Also note that the results of the floating-point method may vary slightly across machines, while the integer methods should give the same results everywhere.

    - integer (the default): This method is faster than “float”, but not as accurate.

    - fast integer: The fast integer method is much less accurate than the other two.

Metadata (edit)

  You can click the “(edit)” link to open the metadata editor to change or add any metadata that you want to be included in the image. Note: you will also still need to enable the relevant metadata saving options listed below.

Metadata

  If the image you loaded has Exif, XMP, IPTC metadata, select which metadata you want to preserve keep when exporting.

  You can also save the color profile, a custom comment to be shown in the Image Properties, and include a small preview thumbnail of the image when exporting.

5.7. Export Image as HEIF/HEIC |  | 5.9. Export Image as MNG

Report a bug in GIMP Report a documentation error