modules.grid package

modules.grid.diagonal_grid(img: numpy.ndarray, cols: int, rows: int, line_width: int = 2, color: Tuple[int] = 0, 0, 0, offset: int = 0) → numpy.ndarray

Draws a diagonal grid (45 degrees) of the specified size on the given image

Parameters
  • img (ImageType) – A numpy array representing an Image

  • cols (int) – Number of columns of the grid

  • rows (int) – Number of rows of the grid

  • line_width (int) – Number of rows of the grid, defults to 2

  • color (Tuple[int]) – Grid strokes color, defults to BLACK

  • offset (int) – Grid strokes offset, defults to 0

Returns

Resultling image

Return type

ImageType

https://mavaras.github.io/stuff/filters_docs/images/me.jpeg https://mavaras.github.io/stuff/filters_docs/images/me_grid_diagonal.jpg
modules.grid.grid(img: numpy.ndarray, cols: int, rows: int, line_width: int = 2, color: Tuple[int] = 0, 0, 0) → numpy.ndarray

Draws a grid of the specified size on the given image

Parameters
  • img (ImageType) – A numpy array representing an Image

  • cols (int) – Number of columns of the grid

  • rows (int) – Number of rows of the grid

  • line_width (int) – Number of rows of the grid, defults to 2

  • color (Tuple[int]) – Grid strokes color, defults to BLACK

Returns

Resultling image

Return type

ImageType

https://mavaras.github.io/stuff/filters_docs/images/me.jpeg https://mavaras.github.io/stuff/filters_docs/images/me_grid.jpg