Skip to main content

Prints the pixels of an image into an array of RGB values, that can be easily exported to embedded applications.

Project description

img2array

Prints the pixels of an image into an array of RGB values. This can be copied easily to other applications, such as embedded apps.

Commands

-h, --help : Help text
-i, --image : Image file path
-p, --prefix : Prefix for the item, like "colorFunc("
-P, --postfix : Postfix for the item, like ")"
-f, --format : Format of the color, defaults to RGB. Possible values: RGB, RGBA, Hex, HexAlpha

Install

pip install img2array

Example

img2array -i file.png --prefix=coolFunction\( --postfix=\) --format=RGB

Note: the \ before () may be required or not depending on the shell you're using.

This should print an array version of the image like

{
    {coolFunction(200,200,200), coolFunction(123,123,123)},
    {coolFunction(111,111,111), coolFunction(41,0,12)}
}

You can then easily copy-paste this to your applications.

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

img2array-1.0.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

img2array-1.0.5-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file img2array-1.0.5.tar.gz.

File metadata

  • Download URL: img2array-1.0.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for img2array-1.0.5.tar.gz
Algorithm Hash digest
SHA256 29080495d327545ed885ed53a9500bd15b166fe7f1d13d77a354b1ca38fabc5e
MD5 15681f939c99c141f9878fb35c17bf63
BLAKE2b-256 77f520a4990bfb62a905a106de425d1c3216cadff8e98dc6da4ed334b1dae939

See more details on using hashes here.

File details

Details for the file img2array-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: img2array-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for img2array-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6637f741e49ff4a7727106beda066d6a4635b358caa2b59b9aeb1e39668d741d
MD5 dd6d1098c4732771ebec569ab7aab8fd
BLAKE2b-256 1c2f6917429cda1617cac55c34009305aec81a0019e74b61a9b004badee876ca

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