Skip to content

Commit

Permalink
Fix type issue for np.zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
Argmaster committed Jan 2, 2024
1 parent d7909c9 commit 537047c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pygerber/backend/rasterized_2d/backend_cls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import TYPE_CHECKING, ClassVar, Optional

import numpy as np
import numpy.typing as npt
from PIL import Image

from pygerber.backend.abstract.backend_cls import Backend, BackendOptions
Expand Down Expand Up @@ -170,7 +171,10 @@ def _replace_image_colors(self) -> None:
np_img = np.array(img)

# Create an empty RGBA image with the same size as the original image
rgba_img = np.zeros((img.height, img.width, 4), dtype=np.uint8)
rgba_img: npt.NDArray[np.uint8] = np.zeros(
(img.height, img.width, 4),
dtype=np.uint8,
)

# For each grayscale value, set the corresponding RGBA value in the new image
for gray_value, rgba in color_map.items():
Expand Down

0 comments on commit 537047c

Please sign in to comment.