Offset OperatorΒΆ

[1]:
import logging
logging.basicConfig(level=logging.INFO)

import graphcat.notebook
import imagecat.notebook

graph = graphcat.StaticGraph()
imagecat.add_task(graph, "/text", imagecat.operator.render.text, string="Offset!")
imagecat.add_task(graph, "/offset", imagecat.operator.transform.offset, offset=("0.5w", 0))
imagecat.set_links(graph, "/text", ("/offset", "image"))

graphcat.notebook.display(graph)
image = graph.output("/offset")
../_images/user-guide_offset_1_0.svg
INFO:imagecat.operator.render:Task /text text:
INFO:imagecat.operator.render:  anchor: mm
INFO:imagecat.operator.render:  fontindex: 0
INFO:imagecat.operator.render:  fontname: /Users/tshead/src/imagecat/imagecat/LeagueSpartan-SemiBold.ttf
INFO:imagecat.operator.render:  fontsize: 0.33h
INFO:imagecat.operator.render:  layer: A
INFO:imagecat.operator.render:  position: ('0.5w', '0.5h')
INFO:imagecat.operator.render:  res: [256 256]
INFO:imagecat.operator.render:  string: Offset!
INFO:imagecat.operator.render:  output: Image(A: Layer(Role.ALPHA 256x256x1 float16))
INFO:imagecat.operator.transform:Task /offset offset:
INFO:imagecat.operator.transform:  layers: *
INFO:imagecat.operator.transform:  offset: ('0.5w', 0)
INFO:imagecat.operator.transform:  output: Image(A: Layer(Role.ALPHA 256x256x1 float16))
[2]:
image.layers["A"]
[2]:
../_images/user-guide_offset_2_0.png