Skip to main content

Roboflex util jpeg Library

Project description

roboflex.util.jpeg

Roboflex support for jpeg compression to file and memory, and jpeg decompression from memory.

Useful for compressing images over slow transports (wifi, etc).

System Dependencies

None! We build jpeg-compression from source...

pip install

pip install roboflex.util.jpeg

Import

import roboflex.util.jpeg as ruj

Nodes

There are two complementary nodes: JPEGCompressor, which can turn rgb tensors into jpegs in memory, and JPEGDecompressor, which does the opposite. Useful either for writing rgb tensors to files, or compressing them (NOTE jpeg is lossy).

# all parameters are optional
c = ruj.JPEGCompressor(

    # in the incoming message, where to find the rgb tensor
    image_key = "rgb",

    # in the outgoing message, where to place the jpeg data
    output_key = "jpeg", 

    # If this is provided, will ALSO write jpeg files with this 
    # prefix, with a variation of the date and time as the suffix.
    filename_prefix = "",

    # name of the node
    name = "JPEGCompressor",

    # prints internal info
    debug = False,
)

... and ...

c = ruj.JPEGDecompressor(

    # in the incoming message, where to find the jpeg data as a blob
    input_key = "jpeg",

    # in the outgoing message, where to place the rgb data as a tensor
    output_key = "rgb", 

    # name of the node
    name = "JPEGDecompressor",

    # prints internal info
    debug = False,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roboflex_util_jpeg-0.1.6.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roboflex_util_jpeg-0.1.6-cp311-cp311-macosx_15_0_arm64.whl (260.1 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file roboflex_util_jpeg-0.1.6.tar.gz.

File metadata

  • Download URL: roboflex_util_jpeg-0.1.6.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for roboflex_util_jpeg-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ad97fbab3e48401e83034bb3f5134647cc3c1b57c082315b43d02be20f665d1e
MD5 8057d5a4daf4dc0ca5b06f83e9b99b2c
BLAKE2b-256 c2d60dfc5588abf90683e28c743879875a11376871b84704f4329005f1445585

See more details on using hashes here.

File details

Details for the file roboflex_util_jpeg-0.1.6-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for roboflex_util_jpeg-0.1.6-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 89e1d8e098c99b9c566ca9019e5b3620f720a2c7030ed7cdb887b2bdd8452f23
MD5 28420009bcd459a828efe6b2cac3c474
BLAKE2b-256 d27c111740266b39666e020162c0382b2fcf35c001f99b958d14de7be41991a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page