Name | pixel-canon JSON |
Version |
0.1.3
JSON |
| download |
home_page | None |
Summary | The canon for pixel data topology. A cross-language specification to define the logical layout of images. |
upload_time | 2025-07-23 00:23:15 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License
Copyright (c) 2025 GolonChenroppi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
|
keywords |
image
pixel
layout
numpy
pytorch
opencv
computer-vision
image-processing
hwc
chw
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Pixel-Canon
**PyPI Homepage** | [**GitHub Repository**](https://github.com/GolonChenroppi/pixel-canon) | [**Specification**](https://github.com/GolonChenroppi/pixel-canon/blob/main/spec/v1.0.md)
---
> The canon for pixel data topology. A cross-language specification to define the logical layout of images (axis order, orientation, and memory order).
`Pixel-Canon` is a cross-language project aimed at solving a common and frustrating problem in computer vision, image processing, and machine learning: the ambiguity of image data layouts. When you receive an N-dimensional array, what do the axes mean? Is it `(Height, Width, Channels)` or `(Channels, Height, Width)`? Does the Y-axis point up or down?
This project provides a simple, declarative specification and a set of tools to describe this information explicitly, eliminating guesswork and making data pipelines more robust and reliable.
## Python Implementation
This package contains the Python implementation of the Pixel-Canon spec.
### Installation
```bash
pip install pixel-canon
```
To include support for `numpy` arrays:
```bash
pip install "pixel-canon[numpy]"
```
### Quick Example
```python
import numpy as np
from pixel_canon import CommonLayouts
from pixel_canon.backends.numpy_backend import convert_numpy
# Your image from a source like OpenCV
image_from_opencv = np.zeros((480, 640, 3), dtype=np.uint8)
layout_from_opencv = CommonLayouts.HWC_ROW_MAJOR_RGB
# The layout required by a library like PyTorch
layout_for_pytorch = CommonLayouts.CHW_ROW_MAJOR_RGB
# Convert the image layout safely and explicitly
prepared_image = convert_numpy(
image_from_opencv,
src=layout_from_opencv,
dst=layout_for_pytorch
)
print(f"Original shape: {image_from_opencv.shape}")
print(f"Converted shape: {prepared_image.shape}")
# Original shape: (480, 640, 3)
# Converted shape: (3, 480, 640)
```
For full documentation, source code for other languages, and to contribute, please visit our main [**GitHub Repository**](https://github.com/GolonChenroppi/pixel-canon).
Raw data
{
"_id": null,
"home_page": null,
"name": "pixel-canon",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "image, pixel, layout, numpy, pytorch, opencv, computer-vision, image-processing, hwc, chw",
"author": null,
"author_email": "GolonChenroppi <golonchenroppi@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/97/01/ee6f52d1e5bc1fa2fef10d9b55edda59e5449c5f67585c5e65f9f90d4c38/pixel_canon-0.1.3.tar.gz",
"platform": null,
"description": "# Pixel-Canon\r\n\r\n**PyPI Homepage** | [**GitHub Repository**](https://github.com/GolonChenroppi/pixel-canon) | [**Specification**](https://github.com/GolonChenroppi/pixel-canon/blob/main/spec/v1.0.md)\r\n\r\n---\r\n\r\n> The canon for pixel data topology. A cross-language specification to define the logical layout of images (axis order, orientation, and memory order).\r\n\r\n`Pixel-Canon` is a cross-language project aimed at solving a common and frustrating problem in computer vision, image processing, and machine learning: the ambiguity of image data layouts. When you receive an N-dimensional array, what do the axes mean? Is it `(Height, Width, Channels)` or `(Channels, Height, Width)`? Does the Y-axis point up or down?\r\n\r\nThis project provides a simple, declarative specification and a set of tools to describe this information explicitly, eliminating guesswork and making data pipelines more robust and reliable.\r\n\r\n## Python Implementation\r\n\r\nThis package contains the Python implementation of the Pixel-Canon spec.\r\n\r\n### Installation\r\n\r\n```bash\r\npip install pixel-canon\r\n```\r\n\r\nTo include support for `numpy` arrays:\r\n```bash\r\npip install \"pixel-canon[numpy]\"\r\n```\r\n\r\n### Quick Example\r\n\r\n```python\r\nimport numpy as np\r\nfrom pixel_canon import CommonLayouts\r\nfrom pixel_canon.backends.numpy_backend import convert_numpy\r\n\r\n# Your image from a source like OpenCV\r\nimage_from_opencv = np.zeros((480, 640, 3), dtype=np.uint8)\r\nlayout_from_opencv = CommonLayouts.HWC_ROW_MAJOR_RGB\r\n\r\n# The layout required by a library like PyTorch\r\nlayout_for_pytorch = CommonLayouts.CHW_ROW_MAJOR_RGB\r\n\r\n# Convert the image layout safely and explicitly\r\nprepared_image = convert_numpy(\r\n image_from_opencv,\r\n src=layout_from_opencv,\r\n dst=layout_for_pytorch\r\n)\r\n\r\nprint(f\"Original shape: {image_from_opencv.shape}\")\r\nprint(f\"Converted shape: {prepared_image.shape}\")\r\n# Original shape: (480, 640, 3)\r\n# Converted shape: (3, 480, 640)\r\n```\r\n\r\nFor full documentation, source code for other languages, and to contribute, please visit our main [**GitHub Repository**](https://github.com/GolonChenroppi/pixel-canon).\r\n",
"bugtrack_url": null,
"license": "MIT License\r\n \r\n Copyright (c) 2025 GolonChenroppi\r\n \r\n Permission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights\r\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n copies of the Software, and to permit persons to whom the Software is\r\n furnished to do so, subject to the following conditions:\r\n \r\n The above copyright notice and this permission notice shall be included in all\r\n copies or substantial portions of the Software.\r\n \r\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n SOFTWARE.\r\n ",
"summary": "The canon for pixel data topology. A cross-language specification to define the logical layout of images.",
"version": "0.1.3",
"project_urls": {
"Bug Tracker": "https://github.com/GolonChenroppi/pixel-canon/issues",
"Documentation": "https://github.com/GolonChenroppi/pixel-canon/blob/main/spec/v1.0.md",
"Homepage": "https://github.com/GolonChenroppi/pixel-canon"
},
"split_keywords": [
"image",
" pixel",
" layout",
" numpy",
" pytorch",
" opencv",
" computer-vision",
" image-processing",
" hwc",
" chw"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e58d1ed6b20134486b4de95c4586a632832f0b9bfab7af5b5a056d9a19ca5e19",
"md5": "b6c1cf1196e5fa5f2868135ea2ffe126",
"sha256": "591e3154cd62e4d2dd6b196f88dff0dd84085b43d05d60afc11fc0c8f2be830f"
},
"downloads": -1,
"filename": "pixel_canon-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b6c1cf1196e5fa5f2868135ea2ffe126",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9618,
"upload_time": "2025-07-23T00:23:13",
"upload_time_iso_8601": "2025-07-23T00:23:13.473739Z",
"url": "https://files.pythonhosted.org/packages/e5/8d/1ed6b20134486b4de95c4586a632832f0b9bfab7af5b5a056d9a19ca5e19/pixel_canon-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9701ee6f52d1e5bc1fa2fef10d9b55edda59e5449c5f67585c5e65f9f90d4c38",
"md5": "662e1a46179ed7206550c8a4fd558659",
"sha256": "762cfb3090065384f78bef88bac35d99155ff7f9d57454b8a4c8cd13377ea760"
},
"downloads": -1,
"filename": "pixel_canon-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "662e1a46179ed7206550c8a4fd558659",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11980,
"upload_time": "2025-07-23T00:23:15",
"upload_time_iso_8601": "2025-07-23T00:23:15.957679Z",
"url": "https://files.pythonhosted.org/packages/97/01/ee6f52d1e5bc1fa2fef10d9b55edda59e5449c5f67585c5e65f9f90d4c38/pixel_canon-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-23 00:23:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GolonChenroppi",
"github_project": "pixel-canon",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pixel-canon"
}