11. Patterns

Vzorek je obrázek, obvykle malý, používaný pro vyplňování oblastí v jiném obrázku dlaždicováním, tedy pokládáním kopií vzorku těsně vedle sebe, jako dlaždiček v koupelně. Pokud sousední levé a pravé strany a horní a dolní strany kopií vzorku nevytvářejí viditelné rušivé hrany, je vzorek tzv. dlaždicovatelný. Ne všechny užitečné vzorky jsou dlaždicovatelné, ale dlaždicovatelné vzorky vypadají obvykle lépe.

Obrázek 7.26. Pattern usage

Pattern usage

Tři způsoby použití vzorku Leopard: vyplnění výběru plechovkou, malování razítkem a vykreslení eliptického výběru vzorkem.


V Gimpu mají vzorky tři uplatnění:

[Tip] Tip

Vzorky nemusí být neprůhledné. Pokud se pro vyplnění použije vzorek z průhlednými nebo průsvitnými oblastmi, zůstane původní obsah oblasti částečně viditelný.

When you install GIMP, it comes presupplied with a few dozen patterns, which seem to have been chosen more or less randomly. You can also add new patterns, either ones you create yourself, or ones you download from the vast number available online.

GIMP's current pattern, used in most pattern-related operations, is shown in the Brush/Pattern/Gradient area of the Toolbox. Clicking on the pattern symbol brings up the Patterns dialog, which allows you to select a different pattern. You can also access the Patterns dialog by menu, or dock it so that it is present continuously.

To add a new pattern to the collection, so that it shows up in the Patterns dialog, you need to save it in a format GIMP can use, in a folder included in GIMP's pattern search path. There are several file formats you can use for patterns:

PAT

The .pat format is used for patterns which were created specifically for GIMP. You can convert any image into a .pat file by opening it in GIMP and then saving it using a file name ending in .pat.

[Výstraha] Výstraha

Do not confuse GIMP-generated .pat files with files created by other programs (e.g. Photoshop) – after all, .pat is just a part of an (arbitrary) file name.

(However, GIMP does support Photoshop .pat files until a certain version.)

PNG, JPEG, BMP, GIF, TIFF

You can use .png, .jpg, .bmp, .gif, or .tiff files as patterns.

To make a pattern available, you place it in one of the folders in GIMP's pattern search path. By default, the pattern search path includes two folders, the system patterns folder, which you should not use or alter, and the patterns folder inside your personal GIMP directory. You can add new folders to the pattern search path using the Pattern Folders page of the Preferences dialog. Any PAT file (or, in GIMP 2.2, any of the other acceptable formats) included in a folder in the pattern search path will show up in the Patterns dialog the next time you start GIMP.

[Poznámka] Poznámka

You can add a new pattern quickly as you do for brushes. See 9.2 – „Creating a brush quickly“.

There are countless ways of creating interesting pattern images in GIMP, using the wide variety of available tools and filters -- particularly the rendering filters. You can find tutorials for this in many locations, including the GIMP home page [GIMP]. Some of the filters have options that allows you to make their results tileable. Also, see 3.13 – „Dlaždicovatelné rozostření“, this filter allows you to blend the edges of an image in order to make it more smoothly tileable.