Kapittel 6. Getting Images out of GIMP

Innhald

1. Filer
1.1. Lagra bilete
1.2. Å lagra biletfiler
2. Å tilpassa bilete for Internett
2.1. Det optimale forholdet mellom storleik og kvalitet
2.2. Å krympe filene litt ekstra
2.3. Lagra gjennomsiktige bilete

1. Filer

The GIMP is capable of reading and writing a large variety of graphics file formats. With the exception of GIMP's native XCF file type, file handling is done by Plugins. Thus, it is relatively easy to extend GIMP to support new file types when the need arises.

Ikkje alle filtypane er like gode for alle føremål. I dette kapitlet vil vi prøve å vise fordeler og ulemper med dei vanlegaste typane.

1.1. Lagra bilete

Når du er ferdig med eit bilete, ønskjer du til vanleg å lagre dette. (Det er forresten ein god idé å lagre bilete innimellom også. GIMP er eit nokså robust program, men truleg vil du før eller seinare oppleve at programmet eller maskinen din krasjar). Som regel vil du lagra bileta i same formatet som dei blei opna i. Det kan likevel vere ein god regel å lagra i GIMP sitt eige filformat XCF medan du arbeider med biletet. Dette fordi nesten alle opplysningane om biletet og arbeidsgangen blir lagra samstundes. Einaste viktige som ikkje blir lagra er angrehistoria. XCF-filene kan, etter det vi kjenner til, ikkje lesast av andre program, så når biletet er ferdig, bør du lagra det i eit meir vanleg format som t.d. JPEG, PNG, TIFF eller liknande.

1.2. Å lagra biletfiler

There are several commands for saving images. A list, and information on how to use them, can be found in the section covering the File Menu.

GIMP allows you to save the images you create in a wide variety of formats. It is important to realize that the only format capable of saving all of the information in an image, including layers, transparency, etc., is GIMP's native XCF format. Every other format preserves some image properties and loses others. When you save an image, GIMP tries to warn you, but it is up to you to understand the capabilities of the format you choose.

Figur 6.1. Eksempel på ein eksportdialog

Eksempel på ein eksportdialog

As stated above, there is no file format, with the exception of GIMP's native XCF format, that is capable of storing all the information in a GIMP image. When you ask to save an image in a format that will lose information, GIMP notifies you, tells you what information will be lost, and asks you whether you would like to “export” the image in a form that the file type can handle. Exporting an image does not modify the image itself, so you do not lose anything by exporting. See Export file.

[Notat] Notat

Når du lukker eit bilete t.d. ved å avslutta GIMP, vil du få opp ei melding dersom biletet er “ureint”, dvs. at biletet er endra utan å bli lagra etterpå. Lagrar du eit bilete, vil biletet etter lagringa bli sett på som “reint”, sjølv om filformatet du valde ikkje lagrar alle biletdata.

1.2.1. Lagra som GIF

Figur 6.2. Lagringsdialogen for GIF

Lagringsdialogen for GIF

[Åtvaring] Åtvaring

The GIF file format does not support some basic image properties such as print resolution. If you care for these properties, use a different file format like PNG.

GIF-innstillingane
Interlace

Checking interlace allows an image on a web page to be progressively displayed as it is downloaded. Progressive image display is useful with slow connection speeds, because you can stop an image that is of no interest; interlace is of less use today with our faster connection speeds.

GIF-kommentar

GIF comments support only 7-bit ASCII characters. If you use a character outside the 7-bit ASCII set, GIMP will save the image without a comment, and then inform you that the comment was not saved.

Innstillingar for GIF-animasjon
Uendeleg sløyfe

When this option is checked, the animation will play repeatedly until you stop it.

Pause mellom rammene når uspesifisert

You can set the delay, in milliseconds, between frames if it has not been set before. In this case, you can modify every delay in the Layer Dialog.

Rammeovergang når uspesifisert

Dersom du ikkje har bestemt dette tidlegare, kan du bestemme korleis skiftet mellom rammene skal gå føre seg. Du har valet mellom

  • I don't care: you can use this option if all your layers are opaque. Layers will overwrite what is beneath.

  • Cumulative Layers (combine): previous frames will not be deleted when a new one is displayed.

  • One frame per layer (replace): previous frames will be deleted before displaying a new frame.

1.2.2. Lagra som JPEG

JPEG-filene har til vanleg endingane .jpg, .JPG eller .jpeg, og er mykje brukt fordi metoden som blir nytta for å komprimera filene gir eit svært godt resultat utan at det går særleg merkbart ut over kvaliteten så lenge komprimeringa er moderat. Det er i så måte ingen andre format som kjem opp mot JPEG. Ulempen er at formatet ikkje støttar gjennomsikt, og heller ikkje samansette lag. Difor blir bilete som skal lagrast som JPEG i GIMP gjerne eksporterte i staden for å bli lagra direkte.

Figur 6.3. Lagringsdialogen for JPEG

Lagringsdialogen for JPEG

Algoritmen for JPEG er eigentleg nokså kompleks, men heldigvis treng du ikkje bry deg om anna enn å justere kvaliteten, og dermed kompresjonen. Resten er for JPEG-ekspertane.

[Obs] Obs

Etter at biletet er lagra som JPEG-fil, vil det bli oppfatta av GIMP som “reint”, dvs. at det kjem ikkje opp noe åtvaring dersom du lukkar det. Sidan JPEG-formatet ikkje lagrar alle opplysningane om biletet, kan dette vere ein ulempe. Difor er det til vanleg lurt å først lagre biletet i GIMP sitt eige XCF-format.

Kvalitet

Når du lagrar eit bilete i JPEG-format, dukkar det opp eit dialogvindauge der du kan setje kvalitetsnivået på ein skala frå 1 til 100. Mellom 95 og 100 er det liten skilnad i kvaliteten. Normalverdien er 85, men ofte kan du setje verdien mykje lågare utan å gjere kvaliteten merkbart dårlegare. Dette kan du kontrollera ved å markere for “Førehandsvising i biletvindauget”. Du endrar ikkje noe på sjølve biletet før du lagrar det, så metoden er trygg.

[Notat] Notat

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.

Førehandsvis i biletvindauget

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.)

Avanserte innstillingar

Litt om dei avanserte innstillingane:

Optimaliser

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.

Progressiv

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).

Lagra EXIF-data

JPEG files from many digital cameras contain extra information, called EXIF data. EXIF data provides information about the image such as camera make and model, image size, image date, etc. Although GIMP uses the “libexif” library to read and write EXIF data, the library is not automatically packaged with GIMP. If GIMP was built with libexif support, then EXIF data is preserved if you open a JPEG file, work with the resulting image, and then save it as JPEG. The EXIF data is not altered in any way when you do this. The EXIF data may indicate things such as image creation time and file name, which may no longer be correct. If GIMP was not built with EXIF support, you can still open JPG files containing EXIF data, but the EXIF data is ignored, and will not be saved when the resulting image is later saved.

Save thumbnail

This option lets you save a thumbnail with the image. Many applications use the small thumbnail image as a quickly available small preview image.

[Notat] Notat

This option is present only if GIMP was built with EXIF support.

Lagra XMP-data

XMP data is “meta” data about the image; it is a competing format with EXIF. If you enable this option, the meta data of the image is saved in an XMP-structure within the file.

Bruk kvalitetsinnstillingane frå originalbiletet

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.

Har du bare gjort noen få endringar i biletet, vil du som oftast få nokså nær same kvalitet og fillengde når du bruker innstillingane frå biletet. Dette vil redusera tapa som kjem som følgje av kvantiseringa i høve til om du bruker andre innstillingar.

Dersom kvalitetsinnstillingane i originalbiletet er dårlegare enn standardinnstillingane, vil kommandoen “ Bruk kvalitetsinnstillingane frå originalbiletet ” vere tilgjengeleg men uverksam. Dette for å sikra at du alltid får ein kvalitet som er minst like god som originalen.

Utjamning

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

Bruk omstartmarkeringar

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.

Mellomsteg

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-metoden

DCT står for “Discrete Cosine Transform”, og er første steget i JPEG-algoritmen. Dette er rein matematikk, og vala du har er “desimaltal”, “heiltal” (normalinnstillinga) og “raske heiltal”:

  • 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.

  • Heiltal: (normalinnstillinga) er raskare enn “desimaltal”, men er ikkje så nøyaktig.

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

Kommentarar

In this text box, you can enter a comment which is saved with the image.

1.2.3. Lagra som PNG

Figur 6.4. Dialogen for “lagra som PNG

Dialogen for lagra som PNG

Flett saman (Adam7)

Checking interlace allows an image on a web page to be progressively displayed as it is downloaded. Progressive image display is useful with slow connection speeds, because you can stop an image that is of no interest; interlace is of less use today with our faster connection speeds.

Lagra bakgrunnsfarge

If your image has many transparency levels, the Internet browsers that recognize only two levels, will use the background color of your Toolbox instead. Internet Explorer up to version 6 did not use this information.

Lagra gamma

Gamma correction is the ability to correct for differences in how computers interpret color values. This saves gamma information in the PNG that reflects the current Gamma factor for your display. Viewers on other computers can then compensate to ensure that the image is not too dark or too bright.

Lagra lagforskyving

PNG supports an offset value called the “oFFs chunk”, which provides position data. Unfortunately, PNG offset support in GIMP is broken, or at least is not compatible with other applications, and has been for a long time. Do not enable offsets, let GIMP flatten the layers before saving, and you will have no problems.

Lagra oppløysing

Save the image resolution, in DPI (dots per inch).

Lagra tid for oppretting

Date the file was saved.

Lagra kommentarane

Dette gjeld kommentarar som du har skrive inn om biletet. Kommentarane kan lesast i vindauget bileteigenskapar.

Lagra fargeverdiar frå gjennomsiktige pikslar

Gjer at fargeverdiane for pikslane blir lagra, sjølv om pikslane er komplett gjennomsiktige.

Kompresjon

Since compression is not lossy, the only reason to use a compression level less than 9, is if it takes too long to compress a file on a slow computer. Nothing to fear from decompression: it is as quick whatever the compression level.

Save Defaults

Click to save the current settings. Latter, you can use Load Defaults to load the saved settings.

[Notat] Notat

The PNG format supports indexed images. Using fewer colors, therefore, results in a smaller file; this is especially useful for creating web images; see Del 6.6, “Indeksert modus”.

Datamaskinene arbeider med 8-bits blokker, såkalla “byte”. Kvar byte kan innehalde opp til 256 ulike fargar. Det er ingen vits i å redusere talet på fargar til under 256 i håp om å redusera filstorleiken sidan det blir brukt ein byte uansett. “PNG8”-formatet har heller ikkje støtte for variabel gjennomsikt, bare gjennomsikt eller ikkje gjennomsikt.

If you want PNG transparency to be fully displayed by Internet Explorer, you can use the AlphaImageLoader DirectX filter in the code of your Web page. See Microsoft Knowledge Base [MSKB-294714]. Please note, that this is not necessary for InternetExplorer 7 and above.

1.2.4. Lagra som TIFF

Figur 6.5. Dialogen for “Lagre som TIFF

Dialogen for Lagre som TIFF

Komprimering

This option allows you to specify the algorithm used to compress the image.

  • None: is fast, and lossless, but the resulting file is very large.

  • LZW: The image is compressed using the “Lempel-Ziv-Welch” algorithm, a lossless compression technique. This is old, but efficient and fast. More information at [WKPD-LZW].

  • Pack Bits: is a fast, simple compression scheme for run-length encoding of data. Apple introduced the PackBits format with the release of MacPaint on the Macintosh computer. A PackBits data stream consists of packets of one byte of header followed by data. (Source: [WKPD-PACKBITS])

  • Deflate: is a lossless data compression algorithm that uses a combination of the LZ77 algorithm and Huffman coding. It is also used in Zip, Gzip and PNG file formats. Source: [WKPD-DEFLATE].

  • JPEG: is a very good compression algorithm but lossy.

  • CCITT Group 3 fax; CCITT Group 4 fax is a black and white format developed to transfer images by FAX.

    [Notat] Notat

    These options can only be selected, if the image is in indexed mode and reduced to two colors. Use ImageModeIndexed to convert the image to indexed. Be certain to check “Use black and white (1-bit) palette”.

Lagra fargeverdiar frå gjennomsiktige pikslar

Gjer at fargeverdiane for pikslane blir lagra, sjølv om pikslane er komplett gjennomsiktige.

Kommentar

In this text box, you can enter a comment that is associated with the image.