geepillow.grids#

A gris is just a nested strip.

Attributes#

Classes#

Grid

Grid.

Module Contents#

class geepillow.grids.Grid(blocks, x_space=10, y_space=10, position='center-center', fit_block=True, keep_proportion=True, size=None, background_color='white', background_opacity=1, mode=DEFAULT_MODE)[source]#

Bases: geepillow.blocks.ImageBlock

Grid.

A vertical strip nested into a horizontal strip.

Parameters:
  • blocks (list[list[geepillow.blocks.Block]]) – a list of Block instances.

  • x_space (int) – the space in pixels between blocks.

  • y_space (int) – the space in pixels between rows.

  • position (tuple | geepillow.blocks.PositionType) – position of the strip inside the block.

  • background_color (str | geepillow.colors.Color) – color of the background.

  • background_opacity (float) – opacity of the background.

  • fit_block (bool) – if True the element’s boundaries will never exceed the block.

  • keep_proportion (bool) – keep proportion (ratio) of the image.

  • size (tuple | None) – size of the block (not the image).

  • mode (str) – mode of the background image.

column_width(n_column)[source]#

Width of the n column.

Parameters:

n_column (int) – the position of the column.

Return type:

int

grid_image()[source]#

Create the grid image.

row_height(n_row)[source]#

Height of the n row.

Parameters:

n_row (int) – the position of the row.

Return type:

int

_background_color[source]#
_blocks[source]#
background_opacity = 1[source]#
property blocks[source]#

Replace None with proxy blocks.

property grid_size: tuple[int, int][source]#

Size of the grid.

Return type:

tuple[int, int]

mode = 'RGBA'[source]#
x_space = 10[source]#
y_space = 10[source]#
geepillow.grids.logger[source]#