Auteur : Claes G Lindblad ported to 2.2 by Victor Ramirez

Shapes active layer according to information from a black & white map.

Create a white map layer and fill the shape you need with black. 
Then use this map layer to displace any other layer. 
Please note that both must have alpha.

Filtres > Mappage > Shape It
Filters > Map > Shape It


Site : http://www.algonet.se/~claesg/shapeit.html


*******************************************************************************************************************************************************



Utilisation (voir test-Shape_It.xcf) :

	Les 2 calques (Shape Map - Calque  dformer) doivent avoir un canal alpha (Calque > Transparence > Ajouter un canal alpha).

	Slectionner le calque "Calque  dformer", activer le filtre par : Filtres > Mappage > Shape It, slectionner le calque "Shape Map", appuyer sur le bouton "OK".
	




*******************************************************************************************************************************************************


Background & Theory.

	Imagine you want a text or an image to follow a shape; like a curve, a roof, or whatever. According to the The Gimp Manual, the best way to do this is to use the Displace filter. The Displace filter is a splendid one, but unfortunately quite tricky to tame, since it wants you to create a gradient map to follow the shape. It is not easy to convert a shape from x-y coordinates into a gradient in x-z space.

	For this reason, I wrote the 'Shape It' plug-in, using an approach which hopefully will be easier to grasp.

	'Shape It' uses two layers: an Active Layer and a Map Layer. The Active Layer is the one which is going to be transformed, and the Map Layer contains information on how to transform the Active Layer.

	The Map Layer works the best if it is just black and white. Each pixel column is read from the top downwards. White pixels are ignored, but as soon as I find the first black pixel, it tells me how much to offset the corresponding column in the Active Layer. No image information is lost, since the Active Layer is wrapped. 




Just five things to remember:

	1) All layers must be of the same size and all must have an Alpha Channel.

	2) The Plug-in always acts on the Active Layer.

	3) Select which layer to use as Shape Map in the Dialog (see illustration above).

	4) Tick 'Invert shape' is you want the shape inverted [what else? :-)].

	5) Enter 'offset amount' if you want to alter the calculated height displacement. 
