Gimp-Forum.net
GEGL graph to fill a layer with a rotated pattern - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Tutorials and tips (https://www.gimp-forum.net/Forum-Tutorials-and-tips)
+--- Thread: GEGL graph to fill a layer with a rotated pattern (/Thread-GEGL-graph-to-fill-a-layer-with-a-rotated-pattern)



GEGL graph to fill a layer with a rotated pattern - tmanni - 07-04-2019

Considere this 400x300 image:

[attachment=2995]

The common way to do this in gimp is :
- create a 800x600 layer (double size compared to image canvas)
- fill it with Filters > Render > Pattern > Checkerboard
- use the unified transform tool to rotate and translate the layer
- crop the layer to the image size

Now with GEGL graph:
- create a 400x300 layer
- run Filters > Generic > GEGL graph and copy paste the text below in the pipeline field

Code:
checkerboard
 x=25
 y=25
 color1=maroon
 color2=silver

rotate
 degrees=45
 origin-x=200
 origin-y=150


Et voilà!

Note that the indentation is only for better visualisation, it is not needed, all can be writen in one line
Code:
checkerboard x=25 y=25 color1=maroon color2=silver rotate degrees=45 origin-x=200 origin-y=150

Another example:
[attachment=2996]
Code:
color value=yellow

over
 aux=[

   grid
     x=64
     line-width=32
     line-height=0
     line-color=black

  rotate
     degrees=45
 ]



RE: GEGL graph to fill a layer with a rotated pattern - Ofnuts - 07-04-2019

You have been bestowed the highly regarded title of "Resident GEGL expert". Congratulations!


RE: GEGL graph to fill a layer with a rotated pattern - tmanni - 07-04-2019

(07-04-2019, 04:46 PM)Ofnuts Wrote: You have been bestowed the highly regarded title of "Resident GEGL expert". Congratulations!

Thanks , Ofnuts.
As a GEGL code contributor, I try to use a lot filters and graph to find new bugs and new usages.