pyRockImageLab
v0.1.0
pyRockImageLab (import pyrockimagelab) turns geological core photographs into clean, depth-labelled images. It crops each core section out of a photo of a whole core box, and it joins (stitches) close-up photos of one section into one long high-resolution image. A small browser app does the clicking; the package functions do the rest, also from notebooks with no windows.
Left: the four corners of one core section on a box photo. Right: the cropped, straightened section (2563–2566 ft, example data in example_data/ExampleCore).
Contact:
Larry Syu-Heng Lai (larrysyuhenglai@gmail.com)
The project was initiated when Larry was affiliated at the Quantitative Clastics Laboratory, Bureau of Economic Geology, The University of Texas at Austin
Installation
From PyPI:
pip install pyrockimagelab
From this repo:
conda env create -f environment.yml
conda activate pyrockimagelab
pip install -e ".[heic]"
No Qt or other GUI toolkit is needed; the app runs in your web browser.
Citation
Lai, L.S.-H. (2026) pyRockImageLab. Zenodo, https://doi.org/10.5281/zenodo.23656974
Key Features
- Browser app
pyrockimagelab-appwith two tools: Crop core-box photo and Stitch close-up photos. - Crop each core section from a box photo by its four corners and straighten it (
ortho_warp_quad). - Join close-up photos along one section into one high-resolution image (
stitch_chain). - Every corner you mark is saved in
_picks.jsonin the photo folder, so notebooks and the command line can re-create the same images without any clicking. - Command-line entry points:
pyrockimagelab-app(the app) andpyrockimagelab(re-create images from saved corners).
The app
pyrockimagelab-app /path/to/CoreImages
This opens the app in your web browser (stop it with Quit, or Ctrl+C in the terminal). The start screen offers two tools:
- Crop core-box photo — Open a photo of a whole core box, mark the corners of each core section, and save each section as its own straightened image labelled with depth.
- Stitch close-up photos — Pick the close-up photos taken along one core section, trim each one, and join them into one long high-resolution image.
Both tools start the same way: in Choose a folder, type the project folder (laid out as Project / Well name / start-end) and press Show photo folders. Every depth folder is listed with what is already done; click the one to work on.
Crop core-box photo
- Choose the box photo — click the photo of the whole core box, then press Use this photo.
- Mark core sections — set how many core sections the box holds, then click the four corners of each section (drag a corner to adjust). Type each section's length in feet; the depth and file name fill in automatically. Preview shows the straightened section.
- Saved images — press Save 3 section images (the number follows your sections). Each section is saved as
{well}_{top}-{bottom}.pngand.tif(300 dpi) in the well folder.
Stitch close-up photos
- Choose close-up photos — pick a core section, click its close-up photos in order (top of the core first), then press Use these photos.
- Trim each photo — click the four corners of the core in each photo to cut away the background (or press Use whole photo), then Next: join the photos.
- Join the photos — Join photos matches overlapping features and joins the photos into one long image. If the result looks wrong, change the matching settings and join again.
- Straighten and save — adjust the four corners of the joined image and press Save image. It is saved as
{well}_{top}-{bottom}_hr.pngand.tif(600 dpi) in the well folder.
You can stop at any time; everything you saved stays on disk, and the app shows where you left off next time.
Example notebooks
pyRockImageLab_1_ExampleCore.ipynb runs end to end on the small example set in example_data/ExampleCore/ (one box photo, six close-up photos and saved corner picks, about 15 MB). It crops, stitches and orthorectifies the close-ups into a high-resolution mosaic of the 2563–2566 ft segment and writes PNGs to outputs/. The notebook only replays the saved corners; to mark your own, use the app (last cell).
The six cropped close-up photos that were stitched, numbered in stitching order (left), beside the stitched high-resolution mosaic of 2563–2566 ft (right).
pyRockImageLab_1_core_photo_processing.ipynb is the full workflow notebook for your own data.
That notebook sets the folder path, opens the app for marking corners, and then re-creates the images from the saved corners with the package functions (no pop-up windows). Put your own core photos outside this repo and pass that folder in.
Caller-supplied layout:
{core_images_dir}/{UWI}/{depth-range}/ # source photos + _picks.json
{core_images_dir}/{UWI}/{UWI}_{start}-{end}[_hr].png
import pyrockimagelab as pril
pril.process_folder(
folder="/path/to/CoreImages/UWI/start-end",
uwi="UWI",
)
pyrockimagelab --root /path/to/CoreImages --uwi UWI --folder start-end
Package structure
README.md
README-pypi.md
FUNCTION_DOCUMENTATION.md
pyproject.toml
setup.py
environment.yml
example_data/ExampleCore/ # anonymized example photos + _picks.json
figures/
pyRockImageLab_1_ExampleCore.ipynb
pyRockImageLab_1_core_photo_processing.ipynb
pyrockimagelab/
common/
image_processing/
core_box/
webapp/ # browser app (pyrockimagelab-app)
Function list: FUNCTION_DOCUMENTATION.md.
Dependencies
Requires Python >=3.10.
Installed with the package: numpy (>=1.20), opencv-python (>=4.5), Pillow (>=8.3), matplotlib (>=3.5, for notebook figures), fastapi (>=0.100), uvicorn (>=0.23).
Optional extras:
heic: pillow-heif >=0.13test: pytest, httpx
License
Program: pyRockImageLab
Interactive tools for core and outcrop image processing, data
collection, and automated geological and geomorphic classification and
analysis
Copyright (C) 2026 Larry Syu-Heng Lai
pyRockImageLab is licensed under the GNU Affero General Public License 3.0 or later. See LICENSE.
Related
- pyLogCrafter (
pylogcrafter) — well-log QC, normalization, imputation, facies, and viz companion package
Metadata
Release files for pyrockimagelab 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyrockimagelab-0.1.0.tar.gz | 53.6 kB | Without provenance | Details for pyrockimagelab-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyrockimagelab-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyrockimagelab-0.1.0-py3-none-any.whl |
Total release size: 110.8 kB
Release files / pyrockimagelab-0.1.0.tar.gz
| Download URL | pyrockimagelab-0.1.0.tar.gz |
|---|---|
| Size | 53.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
165a4600e45d3dc52b77cc53c2405e095275cf7151ebe2958a7a5b6957e442c7
|
|
BLAKE2b-256 checksum How to use checksums |
65a215bff5af0fa1bb7571142174e11c2c70408fec821defe44864508f95c759
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / pyrockimagelab-0.1.0-py3-none-any.whl
| Download URL | pyrockimagelab-0.1.0-py3-none-any.whl |
|---|---|
| Size | 57.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00d2aa698280aff29f182282c27c523c918ffbeec213fefaa4e11adabc18e3d7
|
|
BLAKE2b-256 checksum How to use checksums |
eb04411d3b015bd89f3bd6c6fbcab1e75d431e863979b851197f96f0705538d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for pyrockimagelab 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.