### 4.8. Enfocar (Desenfocar máscara)

#### 4.8.1. Generalidades

Figura 17.48. Ejemplo de aplicación del filtro enfocar

Imagen original

Filter applied

Out-of-focus photographs and most digitized images often need a sharpness correction. This is due to the digitizing process that has to divide a color continuum in points with slightly different colors. Elements smaller than the sampling frequency will be averaged into a uniform color. So sharp borders will be rendered a little blurred. The same phenomenon appears when printing color dots on paper.

The Sharpen filter (previously called Unsharp Mask) sharpens edges of the elements without increasing noise or blemish.

| Sugerencia
Some imaging devices like digital cameras or scanners offer to sharpen the created images for you. We strongly recommend you disable this means of sharpening and use GIMP filters instead. This way you regain the full control over the sharpening of your images.

To prevent color distortion while sharpening, you can Decompose your image to HSV and work only on Value. Go to Colors → Components → Decompose…. Make sure the Decompose to layers box is checked. Choose HSV and click OK. You will get a new gray-level image with three layers, one for Hue, one for Saturation, and one for Value. (Close the original image so you won't get confused). Select the Value layer and apply your sharpening to it. When you are done, with that same layer selected, reverse the process by using Compose. Go to Colors → Components → Compose…. Again choose HSV and click OK. You will get back your original image except that it will have been sharpened in the Value component.

#### 4.8.2. Activating the Filter

This filter is found in the main menu under Filters → Enhance → Sharpen (Unsharp Mask)….

#### 4.8.3. Opciones

Figura 17.49. Opciones del filtro “Enfocar”

Presets, “Input Type”, Recortado, Blending Options, Vista previa, Merge filter, Split view

  | Nota
  Estas opciones se describen en la Sección 2, “Características comunes”.

Radio

  The slider and input boxes (0.0-1500.0) allow you to set how many pixels on either side of an edge will be affected by sharpening. It is better to always sharpen an image at its final resolution.

Cantidad

  This slider and input boxes (0.0-300.0) allow you to set the strength of sharpening.

Umbral

  This slider and input boxes (0.0-1.0) allow you to set the minimum difference in pixel values that indicates an edge where sharpen must be applied. So you can protect areas of smooth tonal transition from sharpening, and avoid creation of blemishes in face, sky or water surface.

#### 4.8.4. ¿Como funciona una máscara de desenfoque?

Usar una máscara de desenfoque para enfocar una imagen puede parecer extraño. Aquí está la explicación:

Piense en una imagen con un contraste en algún lugar. La curva de intensidad de los píxeles en una línea sobre este contraste mostrará un incremento brusco de la intensidad: como una escalera si el contraste es perfectamente nítido, como una «S» si hay un poco de desenfoque.

Tenemos una imagen con un poco de desenfoque que se quiere enfocar (curva negra). Se aplica algo más de desenfoque: la variación de intensidad será más gradual (curva verde).

Restemos la diferencia entre la intensidad de desenfoque (curva verde) y la intensidad de la imagen original (curva negra). Se obtiene la curva roja, que es más brusca: aumenta el contraste y la nitidez. Queda demostrado.

Unsharp mask was first used in silver photography. The photographer first creates a copy of the original negative by contact, on a film, placing a thin glass plate between both; that will produce a blurred copy because of light diffusion. Then both films are placed in a photo enlarger, to reproduce them on paper. The dark areas of the positive blurred film, opposed to the clear areas of the original negative will prevent light to go through and so will be subtracted from the light going through the original film.

En las fotografías digitales, con GIMP, pasará por las siguientes etapas:

1. Abra su imagen y duplíquela Imagen → Duplicar

2. In the copy, duplicate the layer Layer → Duplicate layers, then from the Filters menu apply Blur → Gaussian Blur to the duplicated layer with the default IIR option and radius 5.

3. In the Layers dialog of the duplicated image, change Mode to “Subtract”, and in the right-click menu, select “Merge down”.

4. Pulse y arrastre la única capa que obtuvo en la imagen original, donde aparece como una capa nueva.

5. Change the Mode in this Layers dialog to “Addition”.

Voilà. The “Sharpen (Unsharp Mask)” filter does the same for you.

Al principio de la curva, puede ver una depresión. Si el desenfoque es importante, esta depresión es muy profunda; el resultado de la sustracción puede ser negativo, y una banda de color complementario aparecerá a lo largo de la parte contrastada, o un halo negro alrededor de una estrella en el cielo sobre la luz de fondo de una nebulosa (efecto de ojo negro).

Figura 17.50. Efecto de ojo negro

4.7. Simétrica del vecino más cercano |  | 4.9. Desparasitar

Report a bug in GIMP Report a documentation error