I’ll use one of your tiles here (tell me if this is not acceptable and I’ll remove it!). Here’s how I interpret the method, please correct if I’m wrong:
You begin with one or more polgyons, defined using rectangular raster image and opacity mask - please excuse the rough cropping.
This is copied/mirrored/rotated/translated and rendered to a target output image. An example of “Fo, R-60” in G’MIC:
gmic tile0.png mirror x rotate -60 autocrop
The translations tend to be done in terms of a predefined constant (here triangle side length, height) and a factor.
Given that, I can think of 3 ways to handle it (without changing the “language”):
- Raster based (the current method)
- Vector field based (manipulate source pixel positions rather than the data itself)
- Vertice based (not thought this through but I think it’s possible)
Option 1 is quite simple in G’MIC, but has downsides - aliasing/loss of quality. What do you think? I suppose if you only ever clone “tile zero” then it’s not an issue.
Edit:
Here’s a quick demo of how you can simply define some custom commands in G’MIC to do this:
_tile_Translate : skip ${1=0},${2=0} # this command actually renders as well
split_opacity. n. 0,1 j[1] ..,$1,$2,0,0,1,. rm[-2,-1]
tiling :
v -
t_w={w} t_h={round(1/2*sqrt(3)*$t_w)} # define constants
{3*$t_w},{2*$t_h},1,3 # create the background image
m "_tile_Clone : [$""1]"
m "_tile_Rotate : rotate. $""1 autocrop."
m "_tile_Flop : mirror. x"
m "_tile_Flip : mirror. y"
_tile_Clone 0 _tile_Translate 0
_tile_Clone 0 _tile_Flop _tile_Rotate -60 _tile_Translate {[-1/2*$t_w,0]}
_tile_Clone 0 _tile_Flop _tile_Rotate 60 _tile_Translate {[1/2*$t_w,0]}
_tile_Clone 0 _tile_Flop _tile_Rotate -60 _tile_Flip _tile_Translate {[$t_w,0]}
_tile_Clone 0 _tile_Flip _tile_Translate {[3/2*$t_w,0]}
_tile_Clone 0 _tile_Flop _tile_Rotate 60 _tile_Flip _tile_Translate {[2*$t_w,0]}
_tile_Clone 0 _tile_Flop _tile_Rotate -60 _tile_Translate {[5/2*$t_w,0]}
_tile_Clone 0 _tile_Flip _tile_Translate {[0,$t_h]}
_tile_Clone 0 _tile_Flop _tile_Rotate -60 _tile_Flip _tile_Translate {[-1/2*$t_w,$t_h]}
_tile_Clone 0 _tile_Flop _tile_Rotate 60 _tile_Flip _tile_Translate {[1/2*$t_w,$t_h]}
_tile_Clone 0 _tile_Flop _tile_Rotate -60 _tile_Translate {[$t_w,$t_h]}
_tile_Clone 0 _tile_Translate {[3/2*$t_w,$t_h]}
_tile_Clone 0 _tile_Flop _tile_Rotate 60 _tile_Translate {[2*$t_w,$t_h]}
_tile_Clone 0 _tile_Flop _tile_Rotate -60 _tile_Flip _tile_Translate {[5/2*$t_w,$t_h]}
k[1] v +
The trick here is to define translation as actually drawing the tile. It shouldn’t be too hard to turn this into a filter which accepts a command string, but I find string handling in G’MIC tedious and I ran out of time for now! Seams are clearly visible (I didn’t try to get a better crop) but that can be dealt with in other ways later…
gmic tile0.png tiling