Skip to content

Commit

Permalink
Fix blend mode issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasburger committed Jun 17, 2019
1 parent 19fcde1 commit 49ea0b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pgimp/GimpFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def add_layer_from_numpy(
visible: bool = True,
position: Union[int, str] = 0,
type: LayerType = None,
blend_mode: Union[int, List[int]] = gimpenums.NORMAL_MODE,
timeout: Optional[int] = None,
) -> 'GimpFile':
"""
Expand All @@ -483,6 +484,7 @@ def add_layer_from_numpy(
:param position: Position in the stack of layers. On top = 0, bottom = number of layers.
In case a layer name is specified, the new layer will be added on top of the layer with the given name.
:param type: Layer type. Indexed images should use indexed layers.
:param blend_mode: Affects the display of the current layer. Blend mode normal means no blending.
:param timeout: Execution timeout in seconds.
:return: :py:class:`~pgimp.GimpFile.GimpFile`
"""
Expand All @@ -493,6 +495,7 @@ def add_layer_from_numpy(
visible,
position,
type,
blend_mode,
timeout
)

Expand Down
6 changes: 3 additions & 3 deletions pgimp/gimp/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ def add_layers_from_numpy(image, numpy_file, layer_names, width, height, type, p
height,
type,
position,
opacity[i] if isinstance(opacity, list) else opacity,
mode[i] if isinstance(mode, list) else mode,
visible[i] if isinstance(visible, list) else visible
opacity[i] if isinstance(opacity, list) else float(opacity),
mode[i] if isinstance(mode, list) else int(mode),
visible[i] if isinstance(visible, list) else bool(visible)
))
return layers

Expand Down

0 comments on commit 49ea0b1

Please sign in to comment.