mergechannels 0.1.0__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.

Potentially problematic release.


This version of mergechannels might be problematic. Click here for more details.

Files changed (168) hide show
  1. mergechannels-0.1.0/.github/workflows/CI.yml +233 -0
  2. mergechannels-0.1.0/.gitignore +75 -0
  3. mergechannels-0.1.0/Cargo.lock +269 -0
  4. mergechannels-0.1.0/Cargo.toml +15 -0
  5. mergechannels-0.1.0/LICENSE +21 -0
  6. mergechannels-0.1.0/PKG-INFO +63 -0
  7. mergechannels-0.1.0/README.md +52 -0
  8. mergechannels-0.1.0/assets/builtin_luts/16_colors.lut +0 -0
  9. mergechannels-0.1.0/assets/builtin_luts/5_ramps.lut +256 -0
  10. mergechannels-0.1.0/assets/builtin_luts/6_shades.lut +0 -0
  11. mergechannels-0.1.0/assets/builtin_luts/Cyan Hot.lut +0 -0
  12. mergechannels-0.1.0/assets/builtin_luts/Green Fire Blue.lut +0 -0
  13. mergechannels-0.1.0/assets/builtin_luts/HiLo.lut +0 -0
  14. mergechannels-0.1.0/assets/builtin_luts/ICA.lut +0 -0
  15. mergechannels-0.1.0/assets/builtin_luts/ICA2.lut +0 -0
  16. mergechannels-0.1.0/assets/builtin_luts/ICA3.lut +0 -0
  17. mergechannels-0.1.0/assets/builtin_luts/Magenta Hot.lut +0 -0
  18. mergechannels-0.1.0/assets/builtin_luts/Orange Hot.lut +0 -0
  19. mergechannels-0.1.0/assets/builtin_luts/Rainbow RGB.lut +0 -0
  20. mergechannels-0.1.0/assets/builtin_luts/Red Hot.lut +0 -0
  21. mergechannels-0.1.0/assets/builtin_luts/Thermal.lut +0 -0
  22. mergechannels-0.1.0/assets/builtin_luts/Yellow Hot.lut +0 -0
  23. mergechannels-0.1.0/assets/builtin_luts/blue_orange_icb.lut +0 -0
  24. mergechannels-0.1.0/assets/builtin_luts/brgbcmyw.lut +0 -0
  25. mergechannels-0.1.0/assets/builtin_luts/cool.lut +0 -0
  26. mergechannels-0.1.0/assets/builtin_luts/edges.lut +0 -0
  27. mergechannels-0.1.0/assets/builtin_luts/gem.lut +0 -0
  28. mergechannels-0.1.0/assets/builtin_luts/glasbey.lut +257 -0
  29. mergechannels-0.1.0/assets/builtin_luts/glasbey_inverted.lut +0 -0
  30. mergechannels-0.1.0/assets/builtin_luts/glasbey_on_dark.lut +256 -0
  31. mergechannels-0.1.0/assets/builtin_luts/glow.lut +257 -0
  32. mergechannels-0.1.0/assets/builtin_luts/mpl-inferno.lut +0 -0
  33. mergechannels-0.1.0/assets/builtin_luts/mpl-magma.lut +0 -0
  34. mergechannels-0.1.0/assets/builtin_luts/mpl-plasma.lut +0 -0
  35. mergechannels-0.1.0/assets/builtin_luts/mpl-viridis.lut +1 -0
  36. mergechannels-0.1.0/assets/builtin_luts/phase.lut +257 -0
  37. mergechannels-0.1.0/assets/builtin_luts/physics.lut +0 -0
  38. mergechannels-0.1.0/assets/builtin_luts/royal.lut +0 -0
  39. mergechannels-0.1.0/assets/builtin_luts/sepia.lut +256 -0
  40. mergechannels-0.1.0/assets/builtin_luts/smart.lut +0 -0
  41. mergechannels-0.1.0/assets/builtin_luts/thal.lut +0 -0
  42. mergechannels-0.1.0/assets/builtin_luts/thallium.lut +0 -0
  43. mergechannels-0.1.0/assets/builtin_luts/unionjack.lut +257 -0
  44. mergechannels-0.1.0/assets/christ_luts/3color-BMR.lut +257 -0
  45. mergechannels-0.1.0/assets/christ_luts/3color-CGY.lut +257 -0
  46. mergechannels-0.1.0/assets/christ_luts/3color-RMB.lut +0 -0
  47. mergechannels-0.1.0/assets/christ_luts/3color-YGC.lut +0 -0
  48. mergechannels-0.1.0/assets/christ_luts/BOP blue.lut +257 -0
  49. mergechannels-0.1.0/assets/christ_luts/BOP orange.lut +257 -0
  50. mergechannels-0.1.0/assets/christ_luts/BOP purple.lut +257 -0
  51. mergechannels-0.1.0/assets/christ_luts/I Blue.lut +257 -0
  52. mergechannels-0.1.0/assets/christ_luts/I Bordeaux.lut +257 -0
  53. mergechannels-0.1.0/assets/christ_luts/I Cyan.lut +257 -0
  54. mergechannels-0.1.0/assets/christ_luts/I Forest.lut +257 -0
  55. mergechannels-0.1.0/assets/christ_luts/I Green.lut +257 -0
  56. mergechannels-0.1.0/assets/christ_luts/I Magenta.lut +257 -0
  57. mergechannels-0.1.0/assets/christ_luts/I Purple.lut +257 -0
  58. mergechannels-0.1.0/assets/christ_luts/I Red.lut +257 -0
  59. mergechannels-0.1.0/assets/christ_luts/I Yellow.lut +257 -0
  60. mergechannels-0.1.0/assets/christ_luts/NOTICE +5 -0
  61. mergechannels-0.1.0/assets/christ_luts/OPF fresh.lut +257 -0
  62. mergechannels-0.1.0/assets/christ_luts/OPF orange.lut +257 -0
  63. mergechannels-0.1.0/assets/christ_luts/OPF purple.lut +257 -0
  64. mergechannels-0.1.0/assets/christ_luts/Turbo.lut +257 -0
  65. mergechannels-0.1.0/assets/converted/16_colors.txt +256 -0
  66. mergechannels-0.1.0/assets/converted/3-3-2 RGB.txt +256 -0
  67. mergechannels-0.1.0/assets/converted/3color-BMR.txt +256 -0
  68. mergechannels-0.1.0/assets/converted/3color-CGY.txt +256 -0
  69. mergechannels-0.1.0/assets/converted/3color-RMB.txt +256 -0
  70. mergechannels-0.1.0/assets/converted/3color-YGC.txt +256 -0
  71. mergechannels-0.1.0/assets/converted/5_ramps.txt +256 -0
  72. mergechannels-0.1.0/assets/converted/6_shades.txt +256 -0
  73. mergechannels-0.1.0/assets/converted/BOP blue.txt +256 -0
  74. mergechannels-0.1.0/assets/converted/BOP orange.txt +256 -0
  75. mergechannels-0.1.0/assets/converted/BOP purple.txt +256 -0
  76. mergechannels-0.1.0/assets/converted/Blue.txt +256 -0
  77. mergechannels-0.1.0/assets/converted/Cyan Hot.txt +256 -0
  78. mergechannels-0.1.0/assets/converted/Cyan.txt +256 -0
  79. mergechannels-0.1.0/assets/converted/Fire.txt +256 -0
  80. mergechannels-0.1.0/assets/converted/Grays.txt +256 -0
  81. mergechannels-0.1.0/assets/converted/Green Fire Blue.txt +256 -0
  82. mergechannels-0.1.0/assets/converted/Green.txt +256 -0
  83. mergechannels-0.1.0/assets/converted/HiLo.txt +256 -0
  84. mergechannels-0.1.0/assets/converted/I Blue.txt +256 -0
  85. mergechannels-0.1.0/assets/converted/I Bordeaux.txt +256 -0
  86. mergechannels-0.1.0/assets/converted/I Cyan.txt +256 -0
  87. mergechannels-0.1.0/assets/converted/I Forest.txt +256 -0
  88. mergechannels-0.1.0/assets/converted/I Green.txt +256 -0
  89. mergechannels-0.1.0/assets/converted/I Magenta.txt +256 -0
  90. mergechannels-0.1.0/assets/converted/I Purple.txt +256 -0
  91. mergechannels-0.1.0/assets/converted/I Red.txt +256 -0
  92. mergechannels-0.1.0/assets/converted/I Yellow.txt +256 -0
  93. mergechannels-0.1.0/assets/converted/ICA.txt +256 -0
  94. mergechannels-0.1.0/assets/converted/ICA2.txt +256 -0
  95. mergechannels-0.1.0/assets/converted/ICA3.txt +256 -0
  96. mergechannels-0.1.0/assets/converted/Ice.txt +256 -0
  97. mergechannels-0.1.0/assets/converted/Magenta Hot.txt +256 -0
  98. mergechannels-0.1.0/assets/converted/Magenta.txt +256 -0
  99. mergechannels-0.1.0/assets/converted/OIMB1.txt +256 -0
  100. mergechannels-0.1.0/assets/converted/OIMB2.txt +256 -0
  101. mergechannels-0.1.0/assets/converted/OIMB3.txt +256 -0
  102. mergechannels-0.1.0/assets/converted/OPF fresh.txt +256 -0
  103. mergechannels-0.1.0/assets/converted/OPF orange.txt +256 -0
  104. mergechannels-0.1.0/assets/converted/OPF purple.txt +256 -0
  105. mergechannels-0.1.0/assets/converted/Orange Hot.txt +256 -0
  106. mergechannels-0.1.0/assets/converted/Rainbow RGB.txt +256 -0
  107. mergechannels-0.1.0/assets/converted/Red Hot.txt +256 -0
  108. mergechannels-0.1.0/assets/converted/Red%Green.txt +256 -0
  109. mergechannels-0.1.0/assets/converted/Red.txt +256 -0
  110. mergechannels-0.1.0/assets/converted/Spectrum.txt +256 -0
  111. mergechannels-0.1.0/assets/converted/Thermal.txt +256 -0
  112. mergechannels-0.1.0/assets/converted/Turbo.txt +256 -0
  113. mergechannels-0.1.0/assets/converted/Yellow Hot.txt +256 -0
  114. mergechannels-0.1.0/assets/converted/Yellow.txt +256 -0
  115. mergechannels-0.1.0/assets/converted/betterBlue.txt +256 -0
  116. mergechannels-0.1.0/assets/converted/betterCyan.txt +256 -0
  117. mergechannels-0.1.0/assets/converted/betterGreen.txt +256 -0
  118. mergechannels-0.1.0/assets/converted/betterOrange.txt +256 -0
  119. mergechannels-0.1.0/assets/converted/betterRed.txt +256 -0
  120. mergechannels-0.1.0/assets/converted/betterYellow.txt +256 -0
  121. mergechannels-0.1.0/assets/converted/blue_orange_icb.txt +256 -0
  122. mergechannels-0.1.0/assets/converted/brgbcmyw.txt +256 -0
  123. mergechannels-0.1.0/assets/converted/cool.txt +256 -0
  124. mergechannels-0.1.0/assets/converted/edges.txt +256 -0
  125. mergechannels-0.1.0/assets/converted/gem.txt +256 -0
  126. mergechannels-0.1.0/assets/converted/glasbey.txt +256 -0
  127. mergechannels-0.1.0/assets/converted/glasbey_inverted.txt +256 -0
  128. mergechannels-0.1.0/assets/converted/glasbey_on_dark.txt +256 -0
  129. mergechannels-0.1.0/assets/converted/glow.txt +256 -0
  130. mergechannels-0.1.0/assets/converted/mpl-inferno.txt +256 -0
  131. mergechannels-0.1.0/assets/converted/mpl-magma.txt +256 -0
  132. mergechannels-0.1.0/assets/converted/mpl-plasma.txt +256 -0
  133. mergechannels-0.1.0/assets/converted/mpl-viridis.txt +256 -0
  134. mergechannels-0.1.0/assets/converted/phase.txt +256 -0
  135. mergechannels-0.1.0/assets/converted/physics.txt +256 -0
  136. mergechannels-0.1.0/assets/converted/royal.txt +256 -0
  137. mergechannels-0.1.0/assets/converted/sepia.txt +256 -0
  138. mergechannels-0.1.0/assets/converted/smart.txt +256 -0
  139. mergechannels-0.1.0/assets/converted/thal.txt +256 -0
  140. mergechannels-0.1.0/assets/converted/thallium.txt +256 -0
  141. mergechannels-0.1.0/assets/converted/unionjack.txt +256 -0
  142. mergechannels-0.1.0/assets/zac_luts/OIMB1.lut +0 -0
  143. mergechannels-0.1.0/assets/zac_luts/OIMB2.lut +0 -0
  144. mergechannels-0.1.0/assets/zac_luts/OIMB3.lut +0 -0
  145. mergechannels-0.1.0/assets/zac_luts/betterBlue.lut +0 -0
  146. mergechannels-0.1.0/assets/zac_luts/betterCyan.lut +0 -0
  147. mergechannels-0.1.0/assets/zac_luts/betterGreen.lut +0 -0
  148. mergechannels-0.1.0/assets/zac_luts/betterOrange.lut +0 -0
  149. mergechannels-0.1.0/assets/zac_luts/betterRed.lut +0 -0
  150. mergechannels-0.1.0/assets/zac_luts/betterYellow.lut +0 -0
  151. mergechannels-0.1.0/pyproject.toml +17 -0
  152. mergechannels-0.1.0/pytests/test_colorize.py +131 -0
  153. mergechannels-0.1.0/python/mergechannels/__init__.py +13 -0
  154. mergechannels-0.1.0/python/mergechannels/__init__.pyi +21 -0
  155. mergechannels-0.1.0/python/mergechannels/_blending.py +3 -0
  156. mergechannels-0.1.0/python/mergechannels/_internal.py +56 -0
  157. mergechannels-0.1.0/python/mergechannels/_luts.py +81 -0
  158. mergechannels-0.1.0/python/mergechannels/py.typed +0 -0
  159. mergechannels-0.1.0/scripts/convert_luts_to_txt.ijm +48 -0
  160. mergechannels-0.1.0/scripts/populate_luts.py +71 -0
  161. mergechannels-0.1.0/src/blend.rs +96 -0
  162. mergechannels-0.1.0/src/cmaps.rs +20191 -0
  163. mergechannels-0.1.0/src/colorize.rs +64 -0
  164. mergechannels-0.1.0/src/interface.rs +42 -0
  165. mergechannels-0.1.0/src/lib.rs +15 -0
  166. mergechannels-0.1.0/src/normalize.rs +0 -0
  167. mergechannels-0.1.0/test.ipynb +262 -0
  168. mergechannels-0.1.0/uv.lock +48 -0
@@ -0,0 +1,233 @@
1
+ # This file is autogenerated by maturin v1.8.2
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github
5
+ #
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ - mvp
13
+ tags:
14
+ - '*'
15
+ pull_request:
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ rust_checks_and_python_tests:
23
+ name: Rust Checks and Python Tests
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+
28
+ # Setup Rust toolchain
29
+ - name: Install Rust stable
30
+ uses: dtolnay/rust-toolchain@stable
31
+ with:
32
+ components: rustfmt, clippy
33
+
34
+ # Run Rust format check
35
+ - name: Check Rust formatting
36
+ run: cargo fmt --all -- --check
37
+
38
+ # Run Clippy
39
+ - name: Run Clippy
40
+ run: cargo clippy -- -D warnings
41
+
42
+ # Run Cargo tests
43
+ - name: Run Cargo tests
44
+ run: cargo test
45
+
46
+ # # Setup Python for testing
47
+ # - uses: actions/setup-python@v5
48
+ # with:
49
+ # python-version: 3.x
50
+
51
+ # Install UV
52
+ - name: Install UV
53
+ uses: astral-sh/setup-uv@v5
54
+
55
+ # Create virtual environment and install the project
56
+ - name: Create virtual environment and install
57
+ run: |
58
+ uv venv .venv --python 3.11
59
+ source .venv/bin/activate
60
+ pip install -e .
61
+
62
+ # Run pytest
63
+ - name: Run pytest
64
+ run: |
65
+ source .venv/bin/activate
66
+ pip install pytest
67
+ pytest
68
+
69
+ linux:
70
+ needs: rust_checks_and_python_tests
71
+ runs-on: ${{ matrix.platform.runner }}
72
+ strategy:
73
+ matrix:
74
+ platform:
75
+ - runner: ubuntu-22.04
76
+ target: x86_64
77
+ - runner: ubuntu-22.04
78
+ target: x86
79
+ - runner: ubuntu-22.04
80
+ target: aarch64
81
+ - runner: ubuntu-22.04
82
+ target: armv7
83
+ - runner: ubuntu-22.04
84
+ target: s390x
85
+ - runner: ubuntu-22.04
86
+ target: ppc64le
87
+ steps:
88
+ - uses: actions/checkout@v4
89
+ - uses: actions/setup-python@v5
90
+ with:
91
+ python-version: 3.x
92
+ - name: Build wheels
93
+ uses: PyO3/maturin-action@v1
94
+ with:
95
+ target: ${{ matrix.platform.target }}
96
+ args: --release --out dist --find-interpreter
97
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
98
+ manylinux: auto
99
+ - name: Upload wheels
100
+ uses: actions/upload-artifact@v4
101
+ with:
102
+ name: wheels-linux-${{ matrix.platform.target }}
103
+ path: dist
104
+
105
+ musllinux:
106
+ needs: rust_checks_and_python_tests
107
+ runs-on: ${{ matrix.platform.runner }}
108
+ strategy:
109
+ matrix:
110
+ platform:
111
+ - runner: ubuntu-22.04
112
+ target: x86_64
113
+ - runner: ubuntu-22.04
114
+ target: x86
115
+ - runner: ubuntu-22.04
116
+ target: aarch64
117
+ - runner: ubuntu-22.04
118
+ target: armv7
119
+ steps:
120
+ - uses: actions/checkout@v4
121
+ - uses: actions/setup-python@v5
122
+ with:
123
+ python-version: 3.x
124
+ - name: Build wheels
125
+ uses: PyO3/maturin-action@v1
126
+ with:
127
+ target: ${{ matrix.platform.target }}
128
+ args: --release --out dist --find-interpreter
129
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
130
+ manylinux: musllinux_1_2
131
+ - name: Upload wheels
132
+ uses: actions/upload-artifact@v4
133
+ with:
134
+ name: wheels-musllinux-${{ matrix.platform.target }}
135
+ path: dist
136
+
137
+ windows:
138
+ needs: rust_checks_and_python_tests
139
+ runs-on: ${{ matrix.platform.runner }}
140
+ strategy:
141
+ matrix:
142
+ platform:
143
+ - runner: windows-latest
144
+ target: x64
145
+ - runner: windows-latest
146
+ target: x86
147
+ steps:
148
+ - uses: actions/checkout@v4
149
+ - uses: actions/setup-python@v5
150
+ with:
151
+ python-version: 3.x
152
+ architecture: ${{ matrix.platform.target }}
153
+ - name: Build wheels
154
+ uses: PyO3/maturin-action@v1
155
+ with:
156
+ target: ${{ matrix.platform.target }}
157
+ args: --release --out dist --find-interpreter
158
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
159
+ - name: Upload wheels
160
+ uses: actions/upload-artifact@v4
161
+ with:
162
+ name: wheels-windows-${{ matrix.platform.target }}
163
+ path: dist
164
+
165
+ macos:
166
+ needs: rust_checks_and_python_tests
167
+ runs-on: ${{ matrix.platform.runner }}
168
+ strategy:
169
+ matrix:
170
+ platform:
171
+ - runner: macos-13
172
+ target: x86_64
173
+ - runner: macos-14
174
+ target: aarch64
175
+ steps:
176
+ - uses: actions/checkout@v4
177
+ - uses: actions/setup-python@v5
178
+ with:
179
+ python-version: 3.x
180
+ - name: Build wheels
181
+ uses: PyO3/maturin-action@v1
182
+ with:
183
+ target: ${{ matrix.platform.target }}
184
+ args: --release --out dist --find-interpreter
185
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
186
+ - name: Upload wheels
187
+ uses: actions/upload-artifact@v4
188
+ with:
189
+ name: wheels-macos-${{ matrix.platform.target }}
190
+ path: dist
191
+
192
+ sdist:
193
+ needs: rust_checks_and_python_tests
194
+ runs-on: ubuntu-latest
195
+ steps:
196
+ - uses: actions/checkout@v4
197
+ - name: Build sdist
198
+ uses: PyO3/maturin-action@v1
199
+ with:
200
+ command: sdist
201
+ args: --out dist
202
+ - name: Upload sdist
203
+ uses: actions/upload-artifact@v4
204
+ with:
205
+ name: wheels-sdist
206
+ path: dist
207
+
208
+ release:
209
+ name: Release
210
+ runs-on: ubuntu-latest
211
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
212
+ needs: [linux, musllinux, windows, macos, sdist]
213
+ permissions:
214
+ # Use to sign the release artifacts
215
+ id-token: write
216
+ # Used to upload release artifacts
217
+ contents: write
218
+ # Used to generate artifact attestation
219
+ attestations: write
220
+ steps:
221
+ - uses: actions/download-artifact@v4
222
+ - name: Generate artifact attestation
223
+ uses: actions/attest-build-provenance@v2
224
+ with:
225
+ subject-path: 'wheels-*/*'
226
+ - name: Publish to PyPI
227
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
228
+ uses: PyO3/maturin-action@v1
229
+ env:
230
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
231
+ with:
232
+ command: upload
233
+ args: --non-interactive --skip-existing wheels-*/*
@@ -0,0 +1,75 @@
1
+ /target
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ .pytest_cache/
6
+ *.py[cod]
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ .venv/
14
+ env/
15
+ bin/
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ include/
26
+ man/
27
+ venv/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+
32
+ # Installer logs
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+ pip-selfcheck.json
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .coverage
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+
45
+ # Translations
46
+ *.mo
47
+
48
+ # Mr Developer
49
+ .mr.developer.cfg
50
+ .project
51
+ .pydevproject
52
+
53
+ # Rope
54
+ .ropeproject
55
+
56
+ # Django stuff:
57
+ *.log
58
+ *.pot
59
+
60
+ .DS_Store
61
+
62
+ # Sphinx documentation
63
+ docs/_build/
64
+
65
+ # PyCharm
66
+ .idea/
67
+
68
+ # VSCode
69
+ .vscode/
70
+
71
+ # Pyenv
72
+ .python-version
73
+
74
+ # ignore images
75
+ *.tif*
@@ -0,0 +1,269 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.4.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
10
+
11
+ [[package]]
12
+ name = "cfg-if"
13
+ version = "1.0.0"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
16
+
17
+ [[package]]
18
+ name = "heck"
19
+ version = "0.5.0"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
22
+
23
+ [[package]]
24
+ name = "indoc"
25
+ version = "2.0.5"
26
+ source = "registry+https://github.com/rust-lang/crates.io-index"
27
+ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
28
+
29
+ [[package]]
30
+ name = "lazy_static"
31
+ version = "1.5.0"
32
+ source = "registry+https://github.com/rust-lang/crates.io-index"
33
+ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
34
+
35
+ [[package]]
36
+ name = "libc"
37
+ version = "0.2.169"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
40
+
41
+ [[package]]
42
+ name = "matrixmultiply"
43
+ version = "0.3.9"
44
+ source = "registry+https://github.com/rust-lang/crates.io-index"
45
+ checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a"
46
+ dependencies = [
47
+ "autocfg",
48
+ "rawpointer",
49
+ ]
50
+
51
+ [[package]]
52
+ name = "memoffset"
53
+ version = "0.9.1"
54
+ source = "registry+https://github.com/rust-lang/crates.io-index"
55
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
56
+ dependencies = [
57
+ "autocfg",
58
+ ]
59
+
60
+ [[package]]
61
+ name = "mergechannels"
62
+ version = "0.1.0"
63
+ dependencies = [
64
+ "lazy_static",
65
+ "ndarray",
66
+ "numpy",
67
+ "pyo3",
68
+ ]
69
+
70
+ [[package]]
71
+ name = "ndarray"
72
+ version = "0.16.1"
73
+ source = "registry+https://github.com/rust-lang/crates.io-index"
74
+ checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841"
75
+ dependencies = [
76
+ "matrixmultiply",
77
+ "num-complex",
78
+ "num-integer",
79
+ "num-traits",
80
+ "portable-atomic",
81
+ "portable-atomic-util",
82
+ "rawpointer",
83
+ ]
84
+
85
+ [[package]]
86
+ name = "num-complex"
87
+ version = "0.4.6"
88
+ source = "registry+https://github.com/rust-lang/crates.io-index"
89
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
90
+ dependencies = [
91
+ "num-traits",
92
+ ]
93
+
94
+ [[package]]
95
+ name = "num-integer"
96
+ version = "0.1.46"
97
+ source = "registry+https://github.com/rust-lang/crates.io-index"
98
+ checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
99
+ dependencies = [
100
+ "num-traits",
101
+ ]
102
+
103
+ [[package]]
104
+ name = "num-traits"
105
+ version = "0.2.19"
106
+ source = "registry+https://github.com/rust-lang/crates.io-index"
107
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
108
+ dependencies = [
109
+ "autocfg",
110
+ ]
111
+
112
+ [[package]]
113
+ name = "numpy"
114
+ version = "0.24.0"
115
+ source = "registry+https://github.com/rust-lang/crates.io-index"
116
+ checksum = "a7cfbf3f0feededcaa4d289fe3079b03659e85c5b5a177f4ba6fb01ab4fb3e39"
117
+ dependencies = [
118
+ "libc",
119
+ "ndarray",
120
+ "num-complex",
121
+ "num-integer",
122
+ "num-traits",
123
+ "pyo3",
124
+ "pyo3-build-config",
125
+ "rustc-hash",
126
+ ]
127
+
128
+ [[package]]
129
+ name = "once_cell"
130
+ version = "1.20.3"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
133
+
134
+ [[package]]
135
+ name = "portable-atomic"
136
+ version = "1.10.0"
137
+ source = "registry+https://github.com/rust-lang/crates.io-index"
138
+ checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
139
+
140
+ [[package]]
141
+ name = "portable-atomic-util"
142
+ version = "0.2.4"
143
+ source = "registry+https://github.com/rust-lang/crates.io-index"
144
+ checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"
145
+ dependencies = [
146
+ "portable-atomic",
147
+ ]
148
+
149
+ [[package]]
150
+ name = "proc-macro2"
151
+ version = "1.0.93"
152
+ source = "registry+https://github.com/rust-lang/crates.io-index"
153
+ checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
154
+ dependencies = [
155
+ "unicode-ident",
156
+ ]
157
+
158
+ [[package]]
159
+ name = "pyo3"
160
+ version = "0.24.1"
161
+ source = "registry+https://github.com/rust-lang/crates.io-index"
162
+ checksum = "17da310086b068fbdcefbba30aeb3721d5bb9af8db4987d6735b2183ca567229"
163
+ dependencies = [
164
+ "cfg-if",
165
+ "indoc",
166
+ "libc",
167
+ "memoffset",
168
+ "once_cell",
169
+ "portable-atomic",
170
+ "pyo3-build-config",
171
+ "pyo3-ffi",
172
+ "pyo3-macros",
173
+ "unindent",
174
+ ]
175
+
176
+ [[package]]
177
+ name = "pyo3-build-config"
178
+ version = "0.24.1"
179
+ source = "registry+https://github.com/rust-lang/crates.io-index"
180
+ checksum = "e27165889bd793000a098bb966adc4300c312497ea25cf7a690a9f0ac5aa5fc1"
181
+ dependencies = [
182
+ "once_cell",
183
+ "target-lexicon",
184
+ ]
185
+
186
+ [[package]]
187
+ name = "pyo3-ffi"
188
+ version = "0.24.1"
189
+ source = "registry+https://github.com/rust-lang/crates.io-index"
190
+ checksum = "05280526e1dbf6b420062f3ef228b78c0c54ba94e157f5cb724a609d0f2faabc"
191
+ dependencies = [
192
+ "libc",
193
+ "pyo3-build-config",
194
+ ]
195
+
196
+ [[package]]
197
+ name = "pyo3-macros"
198
+ version = "0.24.1"
199
+ source = "registry+https://github.com/rust-lang/crates.io-index"
200
+ checksum = "5c3ce5686aa4d3f63359a5100c62a127c9f15e8398e5fdeb5deef1fed5cd5f44"
201
+ dependencies = [
202
+ "proc-macro2",
203
+ "pyo3-macros-backend",
204
+ "quote",
205
+ "syn",
206
+ ]
207
+
208
+ [[package]]
209
+ name = "pyo3-macros-backend"
210
+ version = "0.24.1"
211
+ source = "registry+https://github.com/rust-lang/crates.io-index"
212
+ checksum = "f4cf6faa0cbfb0ed08e89beb8103ae9724eb4750e3a78084ba4017cbe94f3855"
213
+ dependencies = [
214
+ "heck",
215
+ "proc-macro2",
216
+ "pyo3-build-config",
217
+ "quote",
218
+ "syn",
219
+ ]
220
+
221
+ [[package]]
222
+ name = "quote"
223
+ version = "1.0.38"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
226
+ dependencies = [
227
+ "proc-macro2",
228
+ ]
229
+
230
+ [[package]]
231
+ name = "rawpointer"
232
+ version = "0.2.1"
233
+ source = "registry+https://github.com/rust-lang/crates.io-index"
234
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
235
+
236
+ [[package]]
237
+ name = "rustc-hash"
238
+ version = "2.1.1"
239
+ source = "registry+https://github.com/rust-lang/crates.io-index"
240
+ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
241
+
242
+ [[package]]
243
+ name = "syn"
244
+ version = "2.0.98"
245
+ source = "registry+https://github.com/rust-lang/crates.io-index"
246
+ checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1"
247
+ dependencies = [
248
+ "proc-macro2",
249
+ "quote",
250
+ "unicode-ident",
251
+ ]
252
+
253
+ [[package]]
254
+ name = "target-lexicon"
255
+ version = "0.13.2"
256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
257
+ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
258
+
259
+ [[package]]
260
+ name = "unicode-ident"
261
+ version = "1.0.16"
262
+ source = "registry+https://github.com/rust-lang/crates.io-index"
263
+ checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034"
264
+
265
+ [[package]]
266
+ name = "unindent"
267
+ version = "0.2.3"
268
+ source = "registry+https://github.com/rust-lang/crates.io-index"
269
+ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
@@ -0,0 +1,15 @@
1
+ [package]
2
+ name = "mergechannels"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+
6
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
+ [lib]
8
+ name = "mergechannels"
9
+ crate-type = ["cdylib"]
10
+
11
+ [dependencies]
12
+ lazy_static = "1.5.0"
13
+ ndarray = "0.16.1"
14
+ numpy = "0.24.0"
15
+ pyo3 = "0.24.1"
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Zachary Swider
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: mergechannels
3
+ Version: 0.1.0
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
7
+ Requires-Dist: numpy>=1.24.4
8
+ License-File: LICENSE
9
+ Requires-Python: >=3.8, <3.13
10
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
11
+
12
+ # mergechannels
13
+
14
+ This project was originally conceived because I often find myself wanting to apply and blend colormaps to images while working from Python, and for historical reasons many of my favorite colormaps are distributed as [FIJI](https://imagej.net/software/fiji/) lookup tables. I also care about things likes speed and memory usage (e.g., not casting large arrays to floating point dtypes), so I was interested in seeing if I could at least match matplotlib's colormapping performance with my own hand-rolled colorizer in Rust.
15
+
16
+ There are other great colormapping libraries available (e.g., [microfilm](https://github.com/guiwitz/microfilm), [cmap](https://github.com/pyapp-kit/cmap)) that are more feature-rich than this projecting on your needs, but which don't address the my goals. My hope is that this project can fill and un-met niche and otherwise maintain full compatibility with these and similar libraries.
17
+
18
+ ## Installation
19
+
20
+ Install pre-compiled binaries from [PyPI](https://pypi.org/project/mergechannels/):
21
+ ```bash
22
+ pip install mergechannels
23
+ ```
24
+
25
+ Build from source on your own machine:
26
+ ```bash
27
+ pip install git+https://github.com/zacswider/mergechannels.git
28
+ ```
29
+
30
+ ## Usage
31
+ *NOTE*: scikit-image is not a dependency of this project, but is used in the examples below to fetch images.
32
+
33
+ ### colorize a single image
34
+
35
+ ```python
36
+ from skimage import data
37
+ import matplotlib.pyplot as plt
38
+ import mergechannels as mc
39
+
40
+ img = data.camera()
41
+ fig, ax = plt.subplots()
42
+ ax.imshow(mc.apply_colormap(img, 'Orange Hot'))
43
+ ```
44
+
45
+ ### apply a different colormap to each channel
46
+ ```python
47
+ from skimage import data
48
+ import matplotlib.pyplot as plt
49
+ import mergechannels as mc
50
+
51
+ cells, nuclei = data.cells3d().max(axis=0)
52
+ cells = to_uint8(cells / cells.max()) <- broken until normalization is handled
53
+ nuclei = to_uint8(nuclei / nuclei.max()) <- broken until normalization is handled
54
+ fig, (a, b, c) = plt.subplots(1, 3)
55
+ a.imshow(cells, cmap='gray')
56
+ b.imshow(nuclei, cmap='gray')
57
+
58
+ import mergechannels as mc
59
+ c.imshow(mc.merge([cells, nuclei], ['Orange Hot', 'Cyan Hot']))
60
+ ```
61
+
62
+ ## Acknowledgements
63
+ This project incorporates a number of colormaps that were hand-crafted by Christophe Leterrier and were originally distributed here under the MIT license: https://github.com/cleterrier/ChrisLUTs