Type to search...

Layer

layer

With the assistance of layers, you can put text or another image under or above a base image. You can apply transformation on the layers as well.

Aliases

  • layero, olayer, lo, l-o: image above the base image
  • layeru, ulayer, lu, l-u: image below the base image
  • texto, otext, to, t-o: text above the base image
  • textu, utext, tu, t-u: text below the base image
  • end: use this to close the layer operation; other items cannot be in the group, and, if you don’t use it, the layer is to be interpreted only on the group that includes the layer definition.

Types

Structure

Since both the text and the public ID may contain an arbitrary sequence of characters, the layer: operation always needs to be the last item in the group and be closed with /-el.

  • layer:<type>:<and more>
  • in the case of using an image
    • layer:<type>:<public ID>
  • in the case of using a text
    • layer:<type>:<parameter(s)>:<text>
    • if there are parameters: layer:<type>::<text>

Limitations

  • you cannot put a new layer on an existing layer (but the base image may contain an arbitrary number of layers)
  • a text and a cloud that is stored in the same cloud can be used as layers
  • the text layer definition should always be the last item in the group, so // (which is the equivalent of the character / ) symbols can be added without having to encode them to %2F
  • the layer closing operation cannot be in the group of a layer initial group and no other operations can be included in it
  • when pasting an image, you can only use them from the ShardImage system, and the image used must be stored in the same cloud as the base item

Dependencies

Examples

Image in over layer

g:face/w:300_ro:max/g:tl_x:10_y:10_l:lo:steve/g:face/wh:100_ro:max/l:end
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace()->group()->width(300)->roundMax()->group()->gTopLeft()->x(10)->y(10)->overlay('steve')->group()->gFace()->group()->size(100)->roundMax()->end();

Transformed image in overlayer

g:face/w:300_ro:max/g:br_x:10_y:10_l:lo:steve/g:face/wh:100_ro:max/r:90_e:blur:200/l:end
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(300)->roundMax()->group()->gBottomRight()->x(10)->y(10)->overlay('steve')->group()->gFace()->group()->size(100)->roundMax()->rotateCW(90)->blur(200)->end();

Image in underlayer

g:face/e:o:60_w:300_ro:max/g:tl_x:10_y:10_l:lu:steve/g:face/wh:100_ro:max/l:end
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace()->group()->opacity(60)->width(300)->roundMax()->group()->gTopLeft()->x(10)->y(10)->underlay('steve')->group()->gFace()->group()->size(100)->roundMax()->end();

Text in overlayer

w:400/g:t_co:green_l:otext:bold,s:30:Olivia
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(400)->group()->gTop()->color('green')->textOverlay('bold,s:30:Olivia');
Table of contents