A Python CLI tool for extracting metadata and raw image data from a combined dtp_data.bin file. The tool automatically creates an output directory containing:
- The original input file
metadata.jsonimage.raw- A preview PNG (optional)
This helps keep all extracted data organized and reproducible.
git clone https://github.com/discosat/image-splitter.git
cd image-splitter
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install .If you have uv installed:
git clone https://github.com/discosat/image-splitter.git
cd image-splitter
uv run image_splitter.cli --helpAfter installation with
pip install ., the CLI can also be run globally asimage-splitterfrom anywhere.
The tool extracts the files into an automatically created output directory named:
output_YYYYMMDD_HHMMSS
You can also supply a custom output directory.
image-splitter <input_file> [--outdir <folder>] [--force] [--no-preview]python -m image_splitter.cli <input_file> [--outdir <folder>] [--force] [--no-preview]uv run image_splitter.cli <input_file> [--outdir <folder>] [--force] [--no-preview]<input_file>— Path to the combined dtp data file (e.g.dtp_data.bin).
| Argument | Description |
|---|---|
--outdir <folder> |
Specify output directory. Default: output_YYYYMMDD_HHMMSS |
--force |
Overwrite output directory if it already exists |
--no-preview |
Skip generating the preview PNG image |
The previous
-m / -ooptions have been removed. Output file names are now automatically generated inside the output folder.
Example:
output_20251122_143443/
├── dtp_data.bin
├── metadata.json
├── image.raw
└── preview_2056x2464_1ch.png
image-splitter dtp_data.binimage-splitter dtp_data.bin --outdir results_sat_03image-splitter dtp_data.bin --outdir output --forceimage-splitter dtp_data.bin --no-previewpython -m image_splitter.cli dtp_data.bin --outdir ~/Downloads/joeThis project includes automated tests using pytest.
pytest -v tests/- Tests are automatically run on every pull request and merge to
main. - Branch protection is configured to prevent merging if tests fail.
The tests include helper fixtures to generate dummy .bin files with valid metadata and image data, so you can run tests without real satellite data.
This project uses Semantic Release to automatically bump versions based on conventional commits.
fix:→ Patch version bumpfeat:→ Minor version bumpBREAKING CHANGE:→ Major version bump
The version is stored in:
image_splitter/__init__.py
No automatic PyPI release is done; version is updated locally and committed via the workflow.
- Preview generation normalizes raw data into 8‑bit PNG.
- Pillow automatically infers image mode (
L,RGB, etc.), so the script does not specify the deprecatedmode=argument. - Metadata is parsed from the protobuf definition in
metadata_pb2.py. - After
pip install ., the CLI is available globally asimage-splitter.
MIT License. See LICENSE for details.