Skip to main content

Python package colorscale

This package was written to facilitate working with ‘false color’. Many scientific fields work with image files to visualize two-dimensional scalar data. The raw data can then be represented as a grayscale image. For different reasons, representing these data in false color can be useful. This package helps to convert grayscale images to ‘false color’. On the other hand, quite often it is desirable to have access to the original values of a false color plot. If the color scale (or ‘color map’) is known and it is bijective (a reversible one to one mapping), the original gray scale image can be recovered from the false color image using this tool, too.

Installation

pip install colorscale

Usage

After installing, two command line tools will be available:

  • to_color_scale and

  • to_gray_scale.

Start them with the --help flag to learn how to use them:

$ to_color_scale --help
usage: to_color_scale [-h] -s {tillscale} [-b {pil,cv2}] IMAGEFILE

Convert an image saved as false color to grayscale

positional arguments:
  IMAGEFILE             The image to convert

optional arguments:
  -h, --help            show this help message and exit
  -s {tillscale}, --colorscale {tillscale}
                        Desired color scale
  -b {pil,cv2}, --backend {pil,cv2}

and

$ to_gray_scale --help
usage: to_gray_scale [-h] -s COLORSCALE IMAGEFILE

Convert an image saved as false color to grayscale

positional arguments:
  IMAGEFILE             The image to convert

optional arguments:
  -h, --help            show this help message and exit
  -s COLORSCALE, --colorscale COLORSCALE {tillscale}
                        Desired color scale

Author

Release files for colorscale 0.8.2

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

Source distribution (sdist)

Source distribution for colorscale 0.8.2
File Size Uploaded
colorscale-0.8.2.tar.gz 5.0 kB Details

Release files / colorscale-0.8.2.tar.gz

Download URL colorscale-0.8.2.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1851ac6f2a4b82b8f6fa957f8337c222d1eebb31694e0ec77b5562b7c577163f
BLAKE2b-256 checksum
How to use checksums
bd271f0d1e6289e5fd934a3365b66158bdbd5b108f4141b489f335b7a1004eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.8.2 This release

1 release file

0.8.0

1 release file

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