Skip to main content

Mapping grayscale images to RGB

Project description

# Grayscale to RGB Python script

Maps grayscale images to RGB based on a custom jet-like colormap. Outputs an images of the same size as the input file. Output image type can be defined by user, outputs png by default.

## How to use

### Dependencies

argparse 1.4.0

matplotlib 3.8.x

### Windows example using cmd python .grayscale_to_rgb.py –input-picture-path .images_inputgrayscale_example.tif –output-picture-path images_outputgrayscale_example_colormapped.png

### Linux

Replace every ` with `/.

## Colormap

Normalized Quantile | Mapped color name | Mapped color HEX code
—— | —— | —— |
0 | black | #000000 |
0.03 | blue | #0000FF |
0.25 | cyan | #00FFFF |
0.50 | lime | #00FF00 |
0.75 | yellow | #FFFF00 |
0.97 | red | #FF0000 |
1 | white | #FFFFFF |

## Example Grayscale to RGB image

Based on the example command

![Grayscale original](https://gitlab.bfabric.org/jens/grayscale-to-rgb/-/blob/main/input_images/grayscale_example.tif)

![Grayscale colormapped](https://gitlab.bfabric.org/jens/grayscale-to-rgb/-/blob/main/output_images/grayscale_example_colormapped.png)

![Original colormapped](https://gitlab.bfabric.org/jens/grayscale-to-rgb/-/blob/main/output_images/rgb_original.jpg)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

grayscale_to_rgb-1.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file grayscale_to_rgb-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for grayscale_to_rgb-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba93380eaee76c75d89d6cf9d01644447d33a5ff744e72b7c6408a29720946d6
MD5 a9b0899c51425a1d9f4dbcde50193375
BLAKE2b-256 0ce40a95f1ef052d1ac5e563a1211d09f2c6d8c83f86dc085edcbe655c5dbfd7

See more details on using hashes here.

Supported by

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