Skip to main content

Data Spree PFNC Pixel Format

Parse and model GenICam PFNC pixel format designations and decode image buffers via extensible decoders. We follow semantic versioning; breaking changes only occur in major versions. Every public symbol defined under pfnc.* is stable.

CI/CD pdm-managed pre-commit

Introduction

This library provides a structured representation of GenICam PFNC pixel format designations and a pluggable system for decoding image buffers into numpy arrays.

It is intended for industrial camera and machine vision use cases where pixel formats are specified using PFNC strings (e.g. RGB8, Mono12Packed, BayerRG10) and need to be parsed, inspected, or decoded outside of a vendor-specific SDK.

The focus of this project is:

  • correct parsing of PFNC designations
  • explicit modeling of pixel format properties
  • extensibility via registries (decoders, data types, components, packing, interface specifics)

This is not a general-purpose image processing library.

Getting Started

Installation

pip install pfnc

or, when using pdm:

pdm add pfnc

Basic Usage

from dataspree.pfnc import PixelFormat

pf = PixelFormat.from_designation("RGB8")

image = pf.decode(
    buffer,
    width=256,
    height=256,
    copy=False,
)

Extending the library

The library is designed to be extensible. You can register custom decoders or extend parsing behavior for additional PFNC variants.

Registering a custom decoder

from dataspree.pfnc import register_decoder, PixelFormatDecoder

class MyDecoder(PixelFormatDecoder):
    priority = 10

    def supports(self, pixel_format) -> bool:
        ...

    def decode(self, data, width, height, *, copy=False):
        ...

register_decoder(MyDecoder)

Advanced extensions

Advanced users may extend:

  • data types
  • components
  • packing rules
  • interface specifics

These extension points are intentionally exposed.

Scope and limitations

Parsing support covers common PFNC designations.

Decoding support depends on available decoders.

Not all packed or planar formats may be decodable out of the box.

See the documentation for details on supported formats.

Metadata

Release files for pfnc 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pfnc 0.1.2
File
pfnc-0.1.2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pfnc-0.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
pfnc-0.1.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pfnc-0.1.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pfnc-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
pfnc-0.1.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 10.7 MB

Release files / pfnc-0.1.2-cp312-cp312-win_amd64.whl

Download URL pfnc-0.1.2-cp312-cp312-win_amd64.whl
Size 567.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4f97586b0a7f1ac7768b2002a249a7c65d87d37cd3a46cfb61096e908b13450c
BLAKE2b-256 checksum
How to use checksums
bf0b9bb481499c5e33e59f283a1f467dcbac8875ad429d14af51c1d677c5307d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pfnc-0.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pfnc-0.1.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 4.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7ec89b44a9fbaa54d6ed2703d7a559ef7f12fff5f1cdee78432f46f4fe873f75
BLAKE2b-256 checksum
How to use checksums
71955ef762d728baf1aba3585338af0973e58562e4306b94669b3bf70746cefc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pfnc-0.1.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL pfnc-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Size 638.3 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e301819d21bc0760b60c2029302f62e022753e8a2cecc73c732d1be8866e1a23
BLAKE2b-256 checksum
How to use checksums
abb5dffe61b4423c21d6e5be1beaaa6bfad68c1e82bb2f132a5067ea48b25467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pfnc-0.1.2-cp310-cp310-win_amd64.whl

Download URL pfnc-0.1.2-cp310-cp310-win_amd64.whl
Size 585.6 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
228a449bfa738220667930bd92556cb8fd3e1407eea55a8875891b93fdff889c
BLAKE2b-256 checksum
How to use checksums
126429960e845e57d91462dff7da65b44ccbb0fad37cd12170bd5af3f9f3e768
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pfnc-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pfnc-0.1.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 4.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
324070e3f44d88f142d3da8bf3a9106818da05625feb1e6291c634eff2c66f3a
BLAKE2b-256 checksum
How to use checksums
b5e7274695cac8787b35c5fdff5f59c1bffc0d619b92d074a98a75d4ed301a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / pfnc-0.1.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL pfnc-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Size 647.6 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2393e21aa8008f5d23dc3ee3105a33e9d30b22f4f3457d9e2cd02319b4dbe8ba
BLAKE2b-256 checksum
How to use checksums
7ef93b6819bc522348368a40d9ea13eee94992a410b0f12eaaf2471feb89a22d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

6 release files

0.1.1

12 release files

0.1.0

10 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page