luvix 0.1.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 (38) hide show
  1. luvix-0.1.1/.gitignore +13 -0
  2. luvix-0.1.1/CHANGELOG.md +49 -0
  3. luvix-0.1.1/LICENSE +201 -0
  4. luvix-0.1.1/PKG-INFO +97 -0
  5. luvix-0.1.1/README.md +62 -0
  6. luvix-0.1.1/pyproject.toml +83 -0
  7. luvix-0.1.1/src/luvix/__init__.py +8 -0
  8. luvix-0.1.1/src/luvix/__main__.py +6 -0
  9. luvix-0.1.1/src/luvix/backends/__init__.py +0 -0
  10. luvix-0.1.1/src/luvix/backends/apple/__init__.py +0 -0
  11. luvix-0.1.1/src/luvix/backends/apple/bridge.py +43 -0
  12. luvix-0.1.1/src/luvix/backends/apple/hdr_probe.py +39 -0
  13. luvix-0.1.1/src/luvix/backends/apple/hdr_probe.swift +121 -0
  14. luvix-0.1.1/src/luvix/backends/apple/hdr_raster.py +37 -0
  15. luvix-0.1.1/src/luvix/backends/apple/hdr_raster.swift +99 -0
  16. luvix-0.1.1/src/luvix/backends/apple/icc_profile.py +78 -0
  17. luvix-0.1.1/src/luvix/backends/apple/icc_profile.swift +31 -0
  18. luvix-0.1.1/src/luvix/backends/apple/imageio.swift +143 -0
  19. luvix-0.1.1/src/luvix/cli.py +208 -0
  20. luvix-0.1.1/src/luvix/doctor.py +96 -0
  21. luvix-0.1.1/src/luvix/hdr/__init__.py +1 -0
  22. luvix-0.1.1/src/luvix/hdr/export.py +108 -0
  23. luvix-0.1.1/src/luvix/hdr/pq.py +39 -0
  24. luvix-0.1.1/src/luvix/hdr/pq_icc.py +75 -0
  25. luvix-0.1.1/src/luvix/hdr/pq_profile.py +50 -0
  26. luvix-0.1.1/src/luvix/hdr/tiff.py +150 -0
  27. luvix-0.1.1/tests/test_cli.py +63 -0
  28. luvix-0.1.1/tests/test_doctor.py +18 -0
  29. luvix-0.1.1/tests/test_export_tiff_cli.py +82 -0
  30. luvix-0.1.1/tests/test_hdr_cli.py +43 -0
  31. luvix-0.1.1/tests/test_hdr_decode_request.py +12 -0
  32. luvix-0.1.1/tests/test_hdr_probe_cli.py +28 -0
  33. luvix-0.1.1/tests/test_hdr_tiff.py +62 -0
  34. luvix-0.1.1/tests/test_linear_p3_icc.py +46 -0
  35. luvix-0.1.1/tests/test_pq.py +35 -0
  36. luvix-0.1.1/tests/test_pq_icc.py +65 -0
  37. luvix-0.1.1/tests/test_pq_profile.py +47 -0
  38. luvix-0.1.1/tests/test_tiff_icc_orientation.py +46 -0
luvix-0.1.1/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .coverage
5
+ .env
6
+ .env.*
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .venv/
10
+ build/
11
+ dist/
12
+ output/
13
+ .DS_Store
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ ## [0.1.0] - 2026-10-10
4
+
5
+ ### Added
6
+ - Apple HDR HEIC inspection and gain-map metadata reporting.
7
+ - Independent SDR base and HDR gain-map extraction.
8
+ - HDR HEIC reconstruction after editing either component.
9
+ - Structural HDR validation.
10
+ - Native Apple HDR decoding into extended linear RGB.
11
+ - 32-bit floating-point linear HDR TIFF export.
12
+ - 16-bit PQ HDR TIFF export with external ICC profile support.
13
+ - Source-aware color management for tested Display P3 and sRGB workflows.
14
+ - Original image orientation preservation.
15
+ - User guide, architecture documentation, and development roadmap.
16
+
17
+ ### Notes
18
+ - Apple HDR HEIC is the currently validated input format.
19
+ - 32-bit linear TIFF export has been validated in Photoshop.
20
+ - 16-bit PQ TIFF export has been validated using an externally supplied
21
+ Adobe-compatible P3 PQ ICC profile.
22
+ - Additional input formats, color spaces, and gain-map standards remain
23
+ on the roadmap.
24
+
25
+
26
+
27
+ All notable changes to Gaincraft will be documented in this file. The format is based on
28
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project follows
29
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
30
+
31
+ ## [Unreleased]
32
+
33
+ HDR processing is planned for 0.0.2.
34
+
35
+ ## [0.0.1] - 2026-07-17
36
+
37
+ ### Added
38
+
39
+ - Initial public Python package and `gaincraft` console entry point.
40
+ - `gaincraft --version`.
41
+ - Read-only `gaincraft doctor` diagnostics with human-readable and JSON output.
42
+ - Packaging, linting, tests, CI, and trusted PyPI publishing configuration.
43
+
44
+ ### Not included
45
+
46
+ - HDR image processing. Gain-map-aware processing begins in 0.0.2.
47
+
48
+ [Unreleased]: https://github.com/orbyts/gaincraft/compare/v0.0.1...HEAD
49
+ [0.0.1]: https://github.com/orbyts/gaincraft/releases/tag/v0.0.1
luvix-0.1.1/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
luvix-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.4
2
+ Name: luvix
3
+ Version: 0.1.1
4
+ Summary: A CLI for validated HDR gain-map image derivative workflows.
5
+ Project-URL: Changelog, https://github.com/orbyts/luvix/blob/main/CHANGELOG.md
6
+ Project-URL: Homepage, https://github.com/orbyts/luvix
7
+ Project-URL: Issues, https://github.com/orbyts/luvix/issues
8
+ Project-URL: Repository, https://github.com/orbyts/luvix
9
+ Author: Suhail
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: gain-map,hdr,jpeg,libvips,ultrahdr
13
+ Classifier: Development Status :: 2 - Pre-Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Multimedia :: Graphics
23
+ Classifier: Topic :: Utilities
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: numpy>=2.4.6
26
+ Requires-Dist: rich<16,>=15
27
+ Requires-Dist: tifffile>=2026.3.3
28
+ Requires-Dist: typer<1,>=0.27
29
+ Provides-Extra: dev
30
+ Requires-Dist: build<2,>=1.3; extra == 'dev'
31
+ Requires-Dist: pytest<10,>=9; extra == 'dev'
32
+ Requires-Dist: ruff<1,>=0.14; extra == 'dev'
33
+ Requires-Dist: twine<7,>=6.2; extra == 'dev'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # Luvix
37
+
38
+ [![Tests](https://github.com/orbyts/luvix/actions/workflows/test.yml/badge.svg)](https://github.com/orbyts/luvix/actions/workflows/test.yml)
39
+
40
+ **Luvix** is a CLI toolkit for HDR gain-map images: inspect, split SDR base and gain map, rebuild edited captures, validate, and export flattened HDR TIFFs.
41
+
42
+ ## Current release-candidate scope
43
+
44
+ The tested backend processes Apple HDR gain-map **HEIC** captures on **macOS** using ImageIO/Core Image and Swift. It supports `inspect`, `extract`, `rebuild`, `validate`, `inspect-hdr`, and `export tiff`. A 32-bit linear float TIFF with matching source-supported ICC has been validated in Photoshop. The 16-bit PQ TIFF was visually validated with an **externally supplied P3 PQ ICC**. General JPEG gain-map input, ISO/Ultra HDR interoperability, and arbitrary ICC source profiles are roadmap items, **not current supported features**.
45
+
46
+ ## Quick start (source checkout)
47
+
48
+ ```bash
49
+ uv sync --extra dev
50
+ uv run luvix doctor
51
+ uv run luvix inspect ~/Pictures/photo.HEIC
52
+ uv run luvix extract ~/Pictures/photo.HEIC --output ~/Pictures/work/photo
53
+ uv run luvix rebuild --source ~/Pictures/photo.HEIC \
54
+ --base ~/Pictures/work/photo/base.png \
55
+ --output ~/Pictures/work/photo_rebuilt.HEIC
56
+ uv run luvix validate --source ~/Pictures/photo.HEIC \
57
+ --output ~/Pictures/work/photo_rebuilt.HEIC
58
+ uv run luvix export tiff ~/Pictures/photo.HEIC \
59
+ --bit-depth 32 --transfer linear --color-space source \
60
+ --output ~/Pictures/work/photo_linear32.tif
61
+ ```
62
+
63
+ For 16-bit PQ output, use a compatible external PQ ICC and explicit reference white:
64
+
65
+ ```bash
66
+ uv run luvix export tiff ~/Pictures/photo.HEIC \
67
+ --bit-depth 16 --transfer pq --color-space source \
68
+ --reference-white 203 --icc-profile ~/ColorProfiles/P3_PQ_Reference.icc \
69
+ --output ~/Pictures/work/photo_pq16.tif
70
+ ```
71
+
72
+ Do not assume the example profile is bundled. Confirm your exact CLI options with `uv run luvix export tiff --help`. Input captures are never modified, but HEIC rebuild may re-encode pixels.
73
+
74
+ ## Documentation
75
+
76
+ - [User guide](docs/USER_GUIDE.md): full command walkthrough, output formats, and troubleshooting.
77
+ - [Architecture](docs/ARCHITECTURE.md): gain-map model, color handling, and format constraints.
78
+ - [Roadmap](ROADMAP.md): planned JPEG, ISO 21496-1, Ultra HDR, multichannel maps, and color-space expansion.
79
+ - [Release checklist](docs/RELEASE_CHECKLIST.md): CI, package verification, merge, publish, and install smoke tests.
80
+ - [Changelog](CHANGELOG.md)
81
+
82
+ ## Development checks
83
+
84
+ ```bash
85
+ uv run ruff check .
86
+ uv run ruff format --check .
87
+ uv run pytest -q
88
+ uv lock --check
89
+ uv build
90
+ uv run --locked twine check dist/*
91
+ ```
92
+
93
+ The native Apple backend requires macOS and `swiftc`. The Python package itself is cross-platform, but this does not imply the Apple HDR features run on Linux.
94
+
95
+ ## License
96
+
97
+ Apache License 2.0. Do not redistribute proprietary reference ICC profiles or private photographs as part of Luvix.
luvix-0.1.1/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Luvix
2
+
3
+ [![Tests](https://github.com/orbyts/luvix/actions/workflows/test.yml/badge.svg)](https://github.com/orbyts/luvix/actions/workflows/test.yml)
4
+
5
+ **Luvix** is a CLI toolkit for HDR gain-map images: inspect, split SDR base and gain map, rebuild edited captures, validate, and export flattened HDR TIFFs.
6
+
7
+ ## Current release-candidate scope
8
+
9
+ The tested backend processes Apple HDR gain-map **HEIC** captures on **macOS** using ImageIO/Core Image and Swift. It supports `inspect`, `extract`, `rebuild`, `validate`, `inspect-hdr`, and `export tiff`. A 32-bit linear float TIFF with matching source-supported ICC has been validated in Photoshop. The 16-bit PQ TIFF was visually validated with an **externally supplied P3 PQ ICC**. General JPEG gain-map input, ISO/Ultra HDR interoperability, and arbitrary ICC source profiles are roadmap items, **not current supported features**.
10
+
11
+ ## Quick start (source checkout)
12
+
13
+ ```bash
14
+ uv sync --extra dev
15
+ uv run luvix doctor
16
+ uv run luvix inspect ~/Pictures/photo.HEIC
17
+ uv run luvix extract ~/Pictures/photo.HEIC --output ~/Pictures/work/photo
18
+ uv run luvix rebuild --source ~/Pictures/photo.HEIC \
19
+ --base ~/Pictures/work/photo/base.png \
20
+ --output ~/Pictures/work/photo_rebuilt.HEIC
21
+ uv run luvix validate --source ~/Pictures/photo.HEIC \
22
+ --output ~/Pictures/work/photo_rebuilt.HEIC
23
+ uv run luvix export tiff ~/Pictures/photo.HEIC \
24
+ --bit-depth 32 --transfer linear --color-space source \
25
+ --output ~/Pictures/work/photo_linear32.tif
26
+ ```
27
+
28
+ For 16-bit PQ output, use a compatible external PQ ICC and explicit reference white:
29
+
30
+ ```bash
31
+ uv run luvix export tiff ~/Pictures/photo.HEIC \
32
+ --bit-depth 16 --transfer pq --color-space source \
33
+ --reference-white 203 --icc-profile ~/ColorProfiles/P3_PQ_Reference.icc \
34
+ --output ~/Pictures/work/photo_pq16.tif
35
+ ```
36
+
37
+ Do not assume the example profile is bundled. Confirm your exact CLI options with `uv run luvix export tiff --help`. Input captures are never modified, but HEIC rebuild may re-encode pixels.
38
+
39
+ ## Documentation
40
+
41
+ - [User guide](docs/USER_GUIDE.md): full command walkthrough, output formats, and troubleshooting.
42
+ - [Architecture](docs/ARCHITECTURE.md): gain-map model, color handling, and format constraints.
43
+ - [Roadmap](ROADMAP.md): planned JPEG, ISO 21496-1, Ultra HDR, multichannel maps, and color-space expansion.
44
+ - [Release checklist](docs/RELEASE_CHECKLIST.md): CI, package verification, merge, publish, and install smoke tests.
45
+ - [Changelog](CHANGELOG.md)
46
+
47
+ ## Development checks
48
+
49
+ ```bash
50
+ uv run ruff check .
51
+ uv run ruff format --check .
52
+ uv run pytest -q
53
+ uv lock --check
54
+ uv build
55
+ uv run --locked twine check dist/*
56
+ ```
57
+
58
+ The native Apple backend requires macOS and `swiftc`. The Python package itself is cross-platform, but this does not imply the Apple HDR features run on Linux.
59
+
60
+ ## License
61
+
62
+ Apache License 2.0. Do not redistribute proprietary reference ICC profiles or private photographs as part of Luvix.
@@ -0,0 +1,83 @@
1
+ [build-system]
2
+ requires = ["hatchling==1.27.0"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "luvix"
7
+ version = "0.1.1"
8
+ description = "A CLI for validated HDR gain-map image derivative workflows."
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Suhail" }]
14
+ keywords = ["hdr", "gain-map", "ultrahdr", "jpeg", "libvips"]
15
+ classifiers = [
16
+ "Development Status :: 2 - Pre-Alpha",
17
+ "Environment :: Console",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
25
+ "Topic :: Multimedia :: Graphics",
26
+ "Topic :: Utilities",
27
+ ]
28
+ dependencies = [
29
+ "numpy>=2.4.6",
30
+ "rich>=15,<16",
31
+ "tifffile>=2026.3.3",
32
+ "typer>=0.27,<1",
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "build>=1.3,<2",
38
+ "pytest>=9,<10",
39
+ "ruff>=0.14,<1",
40
+ "twine>=6.2,<7",
41
+ ]
42
+
43
+ [project.scripts]
44
+ luvix = "luvix.cli:app"
45
+
46
+ [project.urls]
47
+ Changelog = "https://github.com/orbyts/luvix/blob/main/CHANGELOG.md"
48
+ Homepage = "https://github.com/orbyts/luvix"
49
+ Issues = "https://github.com/orbyts/luvix/issues"
50
+ Repository = "https://github.com/orbyts/luvix"
51
+
52
+ [tool.hatch.build.targets.sdist]
53
+ include = [
54
+ "/CHANGELOG.md",
55
+ "/LICENSE",
56
+ "/README.md",
57
+ "/pyproject.toml",
58
+ "/src",
59
+ "/tests",
60
+ ]
61
+
62
+ [tool.hatch.build.targets.wheel]
63
+ packages = ["src/luvix"]
64
+
65
+ [tool.hatch.build.targets.wheel.force-include]
66
+ "src/luvix/backends/apple/imageio.swift" = "luvix/backends/apple/imageio.swift"
67
+
68
+ [tool.pytest.ini_options]
69
+ addopts = "-ra --strict-config --strict-markers"
70
+ testpaths = ["tests"]
71
+
72
+ [tool.ruff]
73
+ line-length = 100
74
+ target-version = "py311"
75
+
76
+ [tool.ruff.lint]
77
+ select = ["B", "E", "F", "I", "RUF", "SIM", "UP"]
78
+
79
+ [dependency-groups]
80
+ dev = [
81
+ "packaging>=26.3",
82
+ "twine>=6.2.0",
83
+ ]
@@ -0,0 +1,8 @@
1
+ """Luvix HDR image processing toolkit."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ __version__ = version("luvix")
7
+ except PackageNotFoundError:
8
+ __version__ = "0+unknown"
@@ -0,0 +1,6 @@
1
+ """Run Luvix with ``python -m luvix``."""
2
+
3
+ from luvix.cli import app
4
+
5
+ if __name__ == "__main__":
6
+ app()
File without changes
File without changes
@@ -0,0 +1,43 @@
1
+ """Compile and execute the macOS ImageIO backend on demand."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import hashlib
6
+ import platform
7
+ import subprocess
8
+ from importlib.resources import files
9
+ from pathlib import Path
10
+
11
+
12
+ class BackendError(RuntimeError):
13
+ """Native backend failed."""
14
+
15
+
16
+ def backend_binary() -> Path:
17
+ if platform.system() != "Darwin":
18
+ raise BackendError("Apple HDR backend requires macOS; no portable backend yet")
19
+ source = Path(str(files("luvix.backends.apple").joinpath("imageio.swift")))
20
+ digest = hashlib.sha256(source.read_bytes()).hexdigest()[:16]
21
+ target = Path.home() / ".cache" / "luvix" / f"imageio-{digest}"
22
+ if not target.exists():
23
+ target.parent.mkdir(parents=True, exist_ok=True)
24
+ result = subprocess.run(
25
+ ["swiftc", "-O", str(source), "-o", str(target)],
26
+ capture_output=True,
27
+ text=True,
28
+ check=False,
29
+ )
30
+ if result.returncode:
31
+ raise BackendError(f"Swift compilation failed:\n{result.stderr}")
32
+ return target
33
+
34
+
35
+ def run_backend(*args: str) -> str:
36
+ result = subprocess.run(
37
+ [str(backend_binary()), *map(str, args)], capture_output=True, text=True, check=False
38
+ )
39
+ if result.returncode:
40
+ raise BackendError(
41
+ result.stderr.strip() or result.stdout.strip() or "Native backend failed"
42
+ )
43
+ return result.stdout.strip()
@@ -0,0 +1,39 @@
1
+ """Build and run the isolated macOS HDR decode diagnostic."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import hashlib
6
+ import platform
7
+ import subprocess
8
+ from importlib.resources import files
9
+ from pathlib import Path
10
+
11
+ from luvix.backends.apple.bridge import BackendError
12
+
13
+
14
+ def run_hdr_probe(source: Path, samples: int) -> str:
15
+ """Return JSON from the native HDR-aware decode probe."""
16
+ if platform.system() != "Darwin":
17
+ raise BackendError("HDR-aware ImageIO decoding requires macOS")
18
+ swift = Path(str(files("luvix.backends.apple").joinpath("hdr_probe.swift")))
19
+ digest = hashlib.sha256(swift.read_bytes()).hexdigest()[:16]
20
+ binary = Path.home() / ".cache" / "luvix" / f"hdr-probe-{digest}"
21
+ if not binary.exists():
22
+ binary.parent.mkdir(parents=True, exist_ok=True)
23
+ result = subprocess.run(
24
+ ["swiftc", "-O", str(swift), "-o", str(binary)],
25
+ capture_output=True,
26
+ text=True,
27
+ check=False,
28
+ )
29
+ if result.returncode:
30
+ raise BackendError(f"Swift compilation failed:\n{result.stderr}")
31
+ result = subprocess.run(
32
+ [str(binary), "inspect-hdr", str(source), str(samples)],
33
+ capture_output=True,
34
+ text=True,
35
+ check=False,
36
+ )
37
+ if result.returncode:
38
+ raise BackendError(result.stderr.strip() or "HDR probe failed")
39
+ return result.stdout.strip()