numpyimage 3.4.1__tar.gz → 3.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: numpyimage
3
- Version: 3.4.1
3
+ Version: 3.4.2
4
4
  Summary: Load, save, & manipulate image files as numpy arrays
5
5
  Author-email: Jasper Phelps <jasper.s.phelps@gmail.com>
6
6
  License: MIT License
@@ -411,7 +411,7 @@ def show(data,
411
411
  if utils.isint(channel_axis) and channel_axis != -1:
412
412
  data = np.moveaxis(data, utils.find_channel_axis(data), -1)
413
413
 
414
- if data.dtype == np.bool:
414
+ if data.dtype == bool:
415
415
  data = data.astype(np.uint8) * 255
416
416
  elif convert_to_8bit and data.dtype != np.uint8:
417
417
  if any(key in convert_kwargs for key in
@@ -134,6 +134,10 @@ def cast(image: np.ndarray,
134
134
  else:
135
135
  raise TypeError(f'Unsupported dtype: {output_dtype}')
136
136
 
137
+ if (bottom_value is not None or top_value is not None
138
+ or bottom_percentile != 0.05 or top_percentile != 99.95):
139
+ maximize_contrast = True
140
+
137
141
  if not maximize_contrast:
138
142
  if (round_before_cast_to_int
139
143
  and np.issubdtype(output_dtype, np.integer)
@@ -67,6 +67,10 @@ def isint(n):
67
67
  This function does NOT recognize integer types from other packages
68
68
  including TensorFlow, PyTorch, or JAX.
69
69
  """
70
+ if isinstance(n, np.ndarray) and n.ndim > 1:
71
+ raise TypeError("npimage.isint is meant for scalars and vectors,"
72
+ " not matrices. Use np.issubdtype(n.dtype, np.integer)"
73
+ " directly if you want to check your array's type.")
70
74
  try:
71
75
  return [np.issubdtype(type(a), np.integer) for a in n]
72
76
  except TypeError:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: numpyimage
3
- Version: 3.4.1
3
+ Version: 3.4.2
4
4
  Summary: Load, save, & manipulate image files as numpy arrays
5
5
  Author-email: Jasper Phelps <jasper.s.phelps@gmail.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
4
4
 
5
5
  [project]
6
6
  name = 'numpyimage'
7
- version = '3.4.1'
7
+ version = '3.4.2'
8
8
  description = 'Load, save, & manipulate image files as numpy arrays'
9
9
  readme.file = 'README.md'
10
10
  readme.content-type = 'text/markdown'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes