Skip to content

Commit b63368b

Browse files
committed
Recommend using a real image library over tcod image loading functions.
1 parent dc1f29d commit b63368b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tcod/image.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import numpy as np
1313

1414
import tcod.console
15-
from tcod._internal import _console
15+
from tcod._internal import _console, deprecate
1616
from tcod.loader import ffi, lib
1717

1818

@@ -329,6 +329,11 @@ def _get_format_name(format: int) -> str:
329329
return str(format)
330330

331331

332+
@deprecate(
333+
"This function may be removed in the future."
334+
" It's recommended to load images with a more complete image library such as python-Pillow or python-imageio.",
335+
category=PendingDeprecationWarning,
336+
)
332337
def load(filename: str) -> np.ndarray:
333338
"""Load a PNG file as an RGBA array.
334339

tcod/libtcodpy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2921,7 +2921,10 @@ def image_is_pixel_transparent(image: tcod.image.Image, x: int, y: int) -> bool:
29212921
return bool(lib.TCOD_image_is_pixel_transparent(image.image_c, x, y))
29222922

29232923

2924-
@pending_deprecate()
2924+
@pending_deprecate(
2925+
"This function may be removed in the future."
2926+
" It's recommended to load images with a more complete image library such as python-Pillow or python-imageio."
2927+
)
29252928
def image_load(filename: str) -> tcod.image.Image:
29262929
"""Load an image file into an Image instance and return it.
29272930

0 commit comments

Comments
 (0)