SimpleImage
SimpleImage copied to clipboard
Multiple overlay
How about add the multiple as $anchor in overlay() such as

This should be what you need, do a test, I use it this way ... I got a piece of my code, I haven't tested it, but it should work .. $transparency = a value from 0 to 100
// ############### APPLY TEXTURE
function applyTexture($imagem, $textura, $texturaTransparencia) {
$imgLargura = $imagem->getWidth();
$imgAltura = $imagem->getHeight();
list($texLargura, $teximgAltura) = getimagesize($textura);
$x = ceil( $imgLargura / $texLargura );
$y = ceil( $imgAltura / $teximgAltura );
for ($linha = 0; $linha < $y; $linha++):
for ($coluna = 0; $coluna < $x; $coluna++):
$imagem->overlay($textura, 'top left', (100-$texturaTransparencia)/100, ($coluna*$texLargura), ($linha*$teximgAltura));
endfor;
endfor;
};
$image = new \claviska\SimpleImage();
$image->fromFile("../url/to/image/image.jpg");
$texture = "../url/to/texture/image.png";
applyTexture($image, $texture, $transparency);
I want to do a PR for this functionality as soon as I have some free time ...