ImageOverlayAbstract
ClassDataClassSource
ImageOverlayAbstract()
The abstract image overlay.
Most properties are not implemented here.
It is only used for providing the common logics of different effects.
Fields
No field is defined.
Abstract methods
overlay
v_1: Image | None = self.overlay(shape: Image)
Generate the overlay image from the given image.
Requires
| Name | Type | Required | |
|---|---|---|---|
shape | Image | An L type image defining the shape of the overlay. This value is provided when rendering the overlaying effect. |
Returns
| Name | Type | |
|---|---|---|
v_1 | Image | None | The generated overlay image. This image can be not This image should be center-aligned with the input Will return |
Methods
compose
v_1: Image = self.compose(comp: ImageComposer, image_bg: Image, image_fg: Image)
Compose the background and foreground images.
This method do not need to be overriden unless the subclass needs to change the behavior of image blending.
Requires
| Name | Type | Required | |
|---|---|---|---|
comp | ImageComposer | The composer that is used for merging images. | |
image_bg | Image | The background image where the effect will be rendered. This image should be in RGB or RGBA. | |
image_fg | Image | The foreground image that will be used as the overlaid layer. This image should be in RGBA. |
Returns
| Name | Type | |
|---|---|---|
v_1 | Image | The composed image. |
render
v_1: Image = self.render(
comp: ImageComposer, image_bg: Image, shape: Image, pos: tuple[int, int]
)
Render this overlay effect.
Requires
| Name | Type | Required | |
|---|---|---|---|
comp | ImageComposer | The composer that is used for merging images. | |
image_bg | Image | The background image where the overlay image will be rendered. This image should be in RGB or RGBA. | |
shape | Image | An L type image defining the shape of the overlay. This value can be provided by the alpha channel of an image. | |
pos | tuple[int, int] | The position shift of the shape. This position means the top left corner of the given shape. This value should be |
Returns
| Name | Type | |
|---|---|---|
v_1 | Image | The image_bg with this effect image rendered on it. |
Properties
intermediate_bg_color
intermediate_bg_color: str | tuple[float, ...] = self.intermediate_bg_color
The intermediate background color. This value may be used when the layer content needs to be rescale.