Skip to main content
# RoyGBiv

This python module is intended to provide a set of image analysis tools. This is very much a work in progress...

_by Giv Parvaneh_
- Demo: http://roygbiv.givp.org/

## Requirements

- Python 2.6+
- Python Imaging Library (PIL)
- NumPy
- ColorMath

Then ```pip install RoyGBiv```

## Usage

```python
>>> from roygbiv import *
>>> roy = Roygbiv('test.png')
>>> roy.get_average_hex()
'#468489'
>>> roy.get_average_rgb()
(70, 132, 137)
>>> roy.get_palette_rgb()
[(87, 145, 138), (52, 126, 140), (44, 97, 117), (154, 168, 145), (199, 194, 158)]
>>> roy.get_palette_hex()
['#57918a', '#347e8c', '#2c6175', '#9aa891', '#c7c29e']
```

## Available methods

- `get_average_hex()` return the average color in the image and return as a hex string
- `get_average_rgb()` return the average color in the image and return as RGB tuple
- `get_palette()` return a list of all prominent colors in the image with prominence weight value
- `get_palette_rgb()` return a list of all prominent colors in RGB
- `get_palette_hex()` return a list of all prominent colors in hex

## Credits

A lot of this code is borrowed from the most excellent [Colorific](https://github.com/99designs/colorific/ "Colorific") project but modified to work with Python 2.6 + other tweaks

Release files for RoyGBiv 0.3

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

Source distribution (sdist)

Source distribution for RoyGBiv 0.3
File Size Uploaded
RoyGBiv-0.3.tar.gz 5.8 kB Details

Release files / RoyGBiv-0.3.tar.gz

Download URL RoyGBiv-0.3.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
19e5750c60bbd1184d68d0624d52fb90c614ee2cda3ba19ab1b57b7e5a6df693
BLAKE2b-256 checksum
How to use checksums
13a4a3b9ba92eadc19a63c1c434869c4a3535f22089549eb277c9770c4897604
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.3.1

1 release file

This release

0.3 This release

1 release file

0.2

2 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