Capitolo 6. Estrarre le immagini da GIMP

Sommario

1. File
1.1. Salvataggio delle immagini
1.2. Salvataggio dei file
2. Preparare immagini per Internet
2.1. Immagini con un rapporto ottimale dimensione/qualità
2.2. Riduzione ulteriore della dimensione dei file
2.3. Salvataggio di immagini con trasparenza

1. File

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.

I tipi di file non sono tutti uguali e soprattutto non sono adatti per ogni scopo. Questa parte della documentazione dovrebbe aiutare a comprendere vantaggi e svantaggi per ogni tipo di file.

1.1. Salvataggio delle immagini

Quando si ha finito di lavorare su di un'immagine, in genere si desidera salvarla. In effetti è sempre una buona idea fare molti salvataggi intermedi, dato che, non si sa mai, GIMP potrebbe anche andare in crash (raro ma non impossibile) o potrebbe mancare la corrente. La maggior parte dei formati di file che GIMP può aprire, possono essere usati anche per salvare. C'è un formato file che è speciale: l'XCF, il formato nativo di GIMP, molto utile perché memorizza quasi ogni informazione relativa all'immagine (non memorizza le modifiche intermedie per gli «annullamenti» ). Perciò il formato XCF è particolarmente interessante per i salvataggi delle versioni intermedie di lavoro e per salvare immagini che devono successivamente essere riaperte in GIMP. I file XCF non sono leggibili dalla gran parte dei programmi di visualizzazione delle immagini perciò, una volta finito il lavoro, è conveniente salvare l'immagine in un formato di uso più diffuso come JPEG, PNG, TIFF, ecc.

1.2. Salvataggio dei file

Ci sono diversi comandi per salvare le immagini. Un elenco corredato di informazioni sull'uso, si trova alla sezione Menu file.

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.

Figura 6.1. Un'esempio di finestra di esportazione immagine

Un'esempio di finestra di esportazione immagine

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.

[Nota] Nota

Quando si chiude un'immagine (probabilmente uscendo da GIMP), si viene avvertiti se l'immagine è "sporca"; cioè, se è stata modificata senza successivamente essere salvata. Salvando un'immagine in qualsiasi formato file, farà in modo di far considerare a GIMP l'immagine come "non sporca", anche se il formato file non garantisce il salvataggio di tutte le informazioni che compongono l'immagine.

1.2.1. Salvataggio in formato GIF

Figura 6.2.  La finestra di dialogo di «salva come GIF»

La finestra di dialogo di salva come GIF

[Avvertimento] Avvertimento

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.

Opzioni GIF
Interlaccia

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.

Commento GIF

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.

Opzioni d'animazione GIF
Ciclo infinito

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

Ritardo predefinito tra fotogrammi

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.

Disposizione del fotogramma dove non specificato

Se non è già stato indicato in precedenza, è possibile impostare come i fotogrammi verranno sovrapposti. Esistono tre scelte:

  • Non importa: è possibile selezionare questa scelta se tutti i livelli sono opachi, ovvero i livelli riscriveranno tutto il sottostante.

  • Livelli cumulativi (combina): i livello precedenti non saranno cancellati quando un nuovo livello viene visualizzato.

  • Un quadro per livello (rimpiazza): i quadri precedenti saranno cancellati prima della visualizzazione del nuovo quadro.

1.2.2. Salvataggio in formato JPEG

I file JPEG normalmente hanno estensione .jpg, .JPG, o .jpeg. È un formato molto diffuso dato che riduce molto la dimensione del file con una perdita minima di qualità dell'immagine. Nessun altro formato raggiunge lo stesso livello di compressione anche se non supporta né la trasparenza né livelli multipli. Per questa ragione, salvare le immagini in formato JPEG richiede spesso di doverle esportare.

Figura 6.3. La finestra di dialogo del salvataggio in formato JPEG

La finestra di dialogo del salvataggio in formato JPEG

L'algoritmo JPEG è piuttosto complesso e coinvolge un grande numero di opzioni il cui significato è oltre lo scopo di questa documentazione. A meno che non vogliate diventare esperti nel formato JPEG, il parametro di qualità è probabilmente l'unico parametro importante da modificare.

[Attenzione] Attenzione

Dopo il salvataggio di un'immagine in formato JPEG, l'immagine non verrà più considerata come «sporca» da GIMP, per cui, a meno che non si effettuino altre modifiche all'immagine, non si verrà più avvertiti della perdita di informazioni in caso di chiusura di GIMP. Dato che la compressione del formato JPEG è di tipo con perdite e che non supporta né trasparenza né livelli multipli, alcune delle informazioni nell'immagine potrebbero andare perse. Se si desidera salvare tutte le informazioni presenti nell'immagine, usare il formato nativo di GIMPXCF.

Qualità

Quando si salva un file in formato JPEG, appare in primo piano una finestra di dialogo che permette di impostare il livello di qualità, il quale può variare da 1 a 100. Valori sopra il 95 non sono però molto utili. Il valore predefinito di 85 normalmente produce eccellenti risultati, ma spesso lo si può abbassare di molto senza degradare l'immagine in maniera percettibile. È possibile controllare l'effetto della differente impostazione di qualità abilitando l'opzione «Mostra anteprima nella finestra immagine» presente nella finestra di salvataggio del formato JPEG. Abilitando quest'opzione si ottiene che ogni cambiamento dell'impostazione di qualità (o di ogni altro parametro JPEG) venga visualizzato in tempo reale nella finestra immagine (comunque ciò non altererà l'immagine originale: essa verrà ripristinata al suo stato originario una volta chiusa la finestra di salvataggio).

[Nota] Nota

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.

Anteprima nella finestra immagine

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

Impostazioni avanzate

Alcune informazioni sulle impostazioni avanzate:

Ottimizza

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.

Progressiva

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

Salva dati EXIF

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.

[Nota] Nota

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

Salva dati XMP

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.

Usa le impostazioni di qualità dell'immagine originale

Se una particolare impostazione di qualità (oppure una «tavola di quantizzazione») è stata utilizzata nell'immagine al momento del caricamento, questa opzione consente di riutilizzarla invece di utilizzare le impostazioni standard.

Se si sono effettuate solo lievi modifiche all'immagine, riutilizzare le stesse impostazioni di qualità consente di avere praticamente la stessa qualità e la stessa dimensione del file dell'immagine originale. Questa impostazione riduce al minimo le perdite causate dalla fase di quantizzazione rispetto all'utilizzo di diverse impostazioni di qualità.

Se le impostazioni di qualità del file originale non sono migliori delle impostazioni di qualità predefinite allora l'opzione «Usa le impostazioni di qualità dell'immagine originale» sarà disponibile ma non selezionata; ciò consente di ottenere sempre almeno la qualità minima garantita dalle impostazioni predefinite. È possibile abilitare questa opzione se non si sono apportate modifiche significative all'immagine, e la si vuole salvare utilizzando le stesse impostazioni di qualità originali.

Smussamento

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

Riavvia marcatori

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.

Sottocampionatura

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.

Metodo DCT

Detto anche «trasformata coseno discreta», il metodo DCT è il primo passo nell'algoritmo JPEG per passare dal dominio spaziale a quello della frequenza. Le scelte sono fra numeri in «virgola mobile», «interi» (il valore predefinito) e «interi veloci». Il metodo in virgola mobile è leggermente più accurato di quello che usa i numeri interi, ma è molto più lento a meno che il computer di cui si dispone non abbia una capacità di calcolo in virgola mobile eccezionalmente potente. Notare anche che i risultati in virgola mobile possono variare leggermente da macchina a macchina, mentre quelli che adottano numeri interi dovrebbero essere gli stessi dappertutto. Il sistema a numeri interi veloci è naturalmente quello meno accurato dei tre.

  • Virgola mobile: il metodo a virgola mobile è leggermente più accurato del metodo per interi, ma è molto più lento a meno che non si disponga di un computer con capacità di calcolo in virgola mobile molto elevata. Da notare che i risultati del metodo in virgola mobile possono variare da macchina a macchina, mentre il metodo per interi dovrebbe dare gli stessi identici risultati su qualunque sistema.

  • interi (valore predefinito): questo metodo è più veloce del metodo a «virgola mobile», ma non così accurato.

  • Interi veloci: il metodo ad interi veloci è molto meno accurato ma più veloce degli altri due.

Commenti allegati all'immagine

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

1.2.3. Salvataggio in formato PNG

Figura 6.4. Il pannello «Salva come PNG»

Il pannello Salva come PNG

Interlacciamento

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.

Salva colore di sfondo

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.

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

Salva spostamento livello

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.

Salva risoluzione

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

Salva data di creazione

Date the file was saved.

Salva commenti

È possibile leggere questi commenti nella finestra Proprietà dell'immagine.

Salva valori colore dai punti trasparenti

Con quest'opzione abilitata, i valori di colore dei pixel vengono salvati anche se i pixel sono completamente trasparenti.

Livello di compressione

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.

[Nota] Nota

The PNG format supports indexed images. Using fewer colors, therefore, results in a smaller file; this is especially useful for creating web images; see Sezione 6.6, «Modalità indicizzata».

I computer lavorano su blocchi di 8 bit chiamati «Byte». Un byte permette 256 colori. Riducendo il numero di colori sotto i 256 non è utile: verrà comunque usato un byte e la dimensione del file non verrà ridotta. Inoltre, questo formato «PNG8», come il GIF, usa solo un bit per la trasparenza; sono utilizzabili perciò solo due livelli di trasparenza: trasparente e opaco.

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. Salvataggio come file TIFF

Figura 6.5.  La finestra di dialogo di salvataggio come file TIFF

La finestra di dialogo di salvataggio come file TIFF

Compressione

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: è uno schema di compressione semplice e veloce con codifica run-length dei dati. Il formato PackBits è stato introdotto da Apple con il rilascio di MacPaint per i computer Macintosh. Un flusso di dati PackBits consiste in pacchetti di dati preceduti da una testata di un byte (fonte: [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.

    [Nota] Nota

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

Salva valori colore dai punti trasparenti

Con questa opzione vengono salvati i i valori dei colori anche se i pixel sono completamente trasparenti.

Commento

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