chromatic-python 0.8.0__tar.gz → 0.8.1__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.
Files changed (57) hide show
  1. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/PKG-INFO +1 -1
  2. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/_version.py +3 -3
  3. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/image/_array.py +14 -21
  4. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic_python.egg-info/PKG-INFO +1 -1
  5. chromatic_python-0.8.1/chromatic_python.egg-info/scm_version.json +8 -0
  6. chromatic_python-0.8.0/chromatic_python.egg-info/scm_version.json +0 -8
  7. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/.gitattributes +0 -0
  8. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/.github/dependabot.yml +0 -0
  9. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/.github/workflows/docs.yml +0 -0
  10. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/.github/workflows/release.yml +0 -0
  11. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/.gitignore +0 -0
  12. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/README.md +0 -0
  13. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/banner.png +0 -0
  14. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/__init__.py +0 -0
  15. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/__init__.pyi +0 -0
  16. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/__main__.py +0 -0
  17. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/_typing.py +0 -0
  18. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/__init__.py +0 -0
  19. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/__init__.pyi +0 -0
  20. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/colorconv.py +0 -0
  21. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/colorconv.pyi +0 -0
  22. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/core.py +0 -0
  23. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/core.pyi +0 -0
  24. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/palette.py +0 -0
  25. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/color/palette.pyi +0 -0
  26. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/__init__.py +0 -0
  27. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/__init__.pyi +0 -0
  28. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/_fetchers.py +0 -0
  29. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/fonts/userfont.schema.json +0 -0
  30. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/fonts/vga437.ttf +0 -0
  31. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/images/butterfly.jpg +0 -0
  32. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/images/escher.png +0 -0
  33. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/images/goblin_virus.png +0 -0
  34. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/images/registry.json +0 -0
  35. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/userfont.py +0 -0
  36. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/data/userfont.pyi +0 -0
  37. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/demo.py +0 -0
  38. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/image/__init__.py +0 -0
  39. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/image/__init__.pyi +0 -0
  40. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/image/_curses.py +0 -0
  41. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic/image/_glyph.py +0 -0
  42. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic_python.egg-info/SOURCES.txt +0 -0
  43. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic_python.egg-info/dependency_links.txt +0 -0
  44. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic_python.egg-info/entry_points.txt +0 -0
  45. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic_python.egg-info/requires.txt +0 -0
  46. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic_python.egg-info/scm_file_list.json +0 -0
  47. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/chromatic_python.egg-info/top_level.txt +0 -0
  48. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/docs/api/chromatic.md +0 -0
  49. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/docs/api/color.md +0 -0
  50. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/docs/api/data.md +0 -0
  51. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/docs/api/image.md +0 -0
  52. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/docs/index.md +0 -0
  53. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/mkdocs.yml +0 -0
  54. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/pyproject.toml +0 -0
  55. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/setup.cfg +0 -0
  56. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/tests/__init__.py +0 -0
  57. {chromatic_python-0.8.0 → chromatic_python-0.8.1}/tests/test_color_str.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chromatic-python
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: ANSI art image processing and colored terminal text
5
5
  Author: crypt0lith
6
6
  License-Expression: MIT
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.8.0'
22
- __version_tuple__ = version_tuple = (0, 8, 0)
21
+ __version__ = version = '0.8.1'
22
+ __version_tuple__ = version_tuple = (0, 8, 1)
23
23
 
24
- __commit_id__ = commit_id = 'g1f588062b'
24
+ __commit_id__ = commit_id = 'ga30deae42'
@@ -399,7 +399,7 @@ class _ConversionHandler:
399
399
  else:
400
400
  arr = np.asarray(im.convert("RGB"), dtype=np.uint8)
401
401
  elif _is_array(im):
402
- arr = np.asarray(im, dtype=np.uint8)
402
+ arr = im.astype(np.uint8)
403
403
  else:
404
404
  raise TypeError
405
405
  if not arr.size:
@@ -446,30 +446,23 @@ class _ConversionHandler:
446
446
  rgb = rgb[None, :]
447
447
  chars = self._chars()
448
448
  ch, cw = _get_bbox_shape(self.font)
449
- char_aspect = ceil(cw / ch)
450
- img_aspect = rgb.shape[2] / rgb.shape[1]
451
- out_w = self.factor
452
- out_h = int(self.factor / img_aspect / char_aspect)
453
- interp = np.empty((rgb.shape[0], out_h, out_w), dtype="<U1")
449
+ out_shape = (
450
+ int(self.factor / (rgb.shape[2] / rgb.shape[1]) / ceil(cw / ch)),
451
+ self.factor,
452
+ )
453
+ interp = np.empty((rgb.shape[0], *out_shape), dtype="<U1")
454
454
  for i in range(rgb.shape[0]):
455
455
  grey = cv.cvtColor(rgb[i], cv.COLOR_RGB2GRAY)
456
456
  blur = grey.astype(np.float64) / 255.0
457
- if (sy := (grey.shape[0] / out_h - 1) / 2) > 0:
458
- blur = cv.filter2D(
459
- blur,
460
- -1,
461
- cv.getGaussianKernel(2 * int(4.0 * sy + 0.5) + 1, sy),
462
- borderType=cv.BORDER_REFLECT_101,
463
- )
464
- if (sx := (grey.shape[1] / out_w - 1) / 2) > 0:
465
- blur = cv.filter2D(
466
- blur,
467
- -1,
468
- cv.getGaussianKernel(2 * int(4.0 * sx + 0.5) + 1, sx).T,
469
- borderType=cv.BORDER_REFLECT_101,
470
- )
457
+ for t, (ax_in, ax_out) in enumerate(zip(grey.shape, out_shape)):
458
+ if (s := (ax_in / ax_out - 1) / 2) <= 0:
459
+ continue
460
+ k = cv.getGaussianKernel(2 * int(4.0 * s + 0.5) + 1, s)
461
+ if t:
462
+ k = k.T
463
+ blur = cv.filter2D(blur, -1, k, borderType=cv.BORDER_REFLECT_101)
471
464
  grey = (
472
- cv.resize(blur, (out_w, out_h), interpolation=cv.INTER_LINEAR) * 255.0
465
+ cv.resize(blur, out_shape[::-1], interpolation=cv.INTER_LINEAR) * 255.0
473
466
  ).astype(np.uint8)
474
467
  interp[i] = chars[np.rint(grey / 255 * (chars.size - 1)).astype(np.intp)]
475
468
  return interp[0] if is_single else interp
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chromatic-python
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: ANSI art image processing and colored terminal text
5
5
  Author: crypt0lith
6
6
  License-Expression: MIT
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.8.1",
3
+ "distance": 0,
4
+ "node": "ga30deae4290bd7c74aa5aa02102cba691f0d3519",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-09-12"
8
+ }
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "0.8.0",
3
- "distance": 0,
4
- "node": "g1f588062b6f6b9d37a3c4efd86878008e6372a07",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-09-10"
8
- }