Utility for converting .VIC/.IMG images to compressed image formats.
Project description
vic2png
Utility for converting .VIC/.IMG images to compressed image formats.
Installation
From PyPI (Not yet implemented)
pip install vic2png
From Source
git clone https://github.jpl.nasa.gov/MIPL/vic2png
cd vic2png/
python3 -m venv venv # Optional
source venv/bin/activate # Optional
pip install .
Usage
Command Line Interface
usage: vic2png [-h] [-o OUT] [-f FORMAT] [-dnmax DNMAX] [-dnmin DNMIN] [--silent] FILE
positional arguments:
FILE Vicar or PDS .VIC/.IMG format file to be converted
options:
-h, --help show this help message and exit
-o OUT, --out OUT Output directory or whole filename
-f FORMAT, --format FORMAT
Output format, default is .png but can provide jpg or tif
-dnmax DNMAX Max. DN value to clip the upper bound of data in the input image.
-dnmin DNMIN Min. DN value to clip the lower bound of data in the input image.
--silent If used, no output will be printed during execution.
Example CLI Usage
# Basic conversion to PNG
vic2png image.vic
# Convert to JPEG with custom output path
vic2png image.vic -o output/converted.jpg
# Convert with DN value clipping (and tif format output)
vic2png image.vic -dnmin 0 -dnmax 255 -f .tif
Python API
This package can be used directly in Python scripts:
from vic2png import vic2png
# Basic conversion
out_png = vic2png("image.vic")
# Advanced usage with all options
out_path = vic2png(
source=Path("image.vic"),
out=Path("output/converted.jpg"),
fmt=".jpg",
dnmin=0,
dnmax=255,
verbose=True
)
Author
Jacqueline Ryan, Jet Propulsion Laboratory
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vic2png-0.4.0.tar.gz
(920.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
vic2png-0.4.0-py3-none-any.whl
(11.4 kB
view details)
File details
Details for the file vic2png-0.4.0.tar.gz.
File metadata
- Download URL: vic2png-0.4.0.tar.gz
- Upload date:
- Size: 920.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89749cc74ada0f46b5275bee1afce81833e776f69c5db131b4a0ead7e87cb38e
|
|
| MD5 |
02fc12bb19fcbbd94fd795f12cbde4d2
|
|
| BLAKE2b-256 |
a7c6aa7f9271313c3cbe8f431045487b2732bbc80ff02cae399351e51984700a
|
File details
Details for the file vic2png-0.4.0-py3-none-any.whl.
File metadata
- Download URL: vic2png-0.4.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c2cfde83fa1ebdfafe2219a6acad3cbb72b4e09b8878543db7033313dbc2063
|
|
| MD5 |
b709a50c2009f2da826aa218adb8a3f3
|
|
| BLAKE2b-256 |
303a382fdf57eaea478b340d76cf746abd24be4889bb94ce27bb76c0ef17219d
|