Metadata-Version: 2.4
Name: image_tiles
Version: 0.1.4
Summary: Serve a webpage with images from a folder.
Project-URL: Homepage, https://github.com/moonshinelabs/image_tiles
Author-email: Nate Harada <image_tiles@moonshinelabs.ai>
License: MIT
License-File: LICENSE
Keywords: image,tiles,visualize
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Requires-Dist: flask==3.0.2
Requires-Dist: imageio==2.24.0
Requires-Dist: loguru==0.6.0
Requires-Dist: numpy>=1.26.0
Requires-Dist: smart-open==6.3.0
Requires-Dist: tifffile==2022.10.10
Provides-Extra: all
Requires-Dist: boto3>=1.26.54; extra == 'all'
Requires-Dist: google-cloud-storage>=2.0.0; extra == 'all'
Provides-Extra: aws
Requires-Dist: boto3>=1.26.54; extra == 'aws'
Provides-Extra: gcp
Requires-Dist: google-cloud-storage>=2.0.0; extra == 'gcp'
Description-Content-Type: text/markdown

# Image Tiles

*A Moonshine Labs tool*

## Overview

A simple but flexible tool to view a folder full of images on your web browser.
Features:

- Run one command and serve a folder of images in any format PIL supports.
- Easily view images on another computer, such as when working via SSH or remotely.
- Support for AWS S3 and Google Cloud Storage buckets.
- Normalization and rendering options for a variety of multispectral images, especially
  satellites.
- Support for multichannel TIFF, JP2, and other less common file formats.

## Quickstart
Run `uvx image_tiles /path/to/folder`

## Installation

```bash
# Install default installation
$ pip install image_tiles

# Install with AWS S3 support
$ pip install image_tiles[aws]

# Install with Google Cloud Storage support
$ pip install image_tiles[gcp]

# Install with all cloud backends
$ pip install image_tiles[all]
```

### Using uvx

You can also run image_tiles directly with `uvx` without installing:

```bash
# Run with default installation
$ uvx image_tiles /path/to/folder

# Run with AWS S3 support
$ uvx --with 'image_tiles[aws]' image_tiles s3://my-bucket/images/

# Run with Google Cloud Storage support
$ uvx --with 'image_tiles[gcp]' image_tiles gs://my-bucket/images/

# Run with all cloud backends
$ uvx --with 'image_tiles[all]' image_tiles /path/to/folder
```

## Usage

```bash
# Serve local images
$ image_tiles ./path_to_folder

# Serve images from AWS S3
$ image_tiles s3://my-bucket/images/

# Serve images from Google Cloud Storage
$ image_tiles gs://my-bucket/images/
```

### Serving a folder of JPEGs (images from instagram.com/dustinlefevre)

![example_page](docs_images/image_tiles_demo.png)

### Serving a folder of multispectral TIFFs:

![example_sat](docs_images/image_tiles_sat.png)

### Rendering options

- `rgb`: Standard RGB image rendering (default).
- `bgr`: BGR image rendering.
- `bw`: Grayscale image rendering from the first 3 channels.
- `sentinel`: Render using channels\[1:4\] for sentinel satellite data.

### Normalization options

- `standard`: If the image is a standard 1/3 channel image, leave it alone. Otherwise
  apply `scaling` (default)
- `scaling`: Scale to 0-255, clipping negative numbers and scaling positive numbers.
- `sigmoid`: Sigmoid normalization, as described in
  [xarray true color](https://xarray-spatial.org/reference/_autosummary/xrspatial.multispectral.true_color.html)
- `sentinel`: Sentinel-2 specific normalization, as described at the Sentinel 2
  [user guide](https://sentinels.copernicus.eu/web/sentinel/user-guides/sentinel-2-msi/definitions)

## Current Limitations

- Only a subset of useful normalization and rendering options supported. Help
  contribute!
- Eventually we'd like to more easily support user code and functions.
- Must restart the server to change some options.
