Skip to main content

Infiray IRG file format parser

This python module contains a simple parser for the "IRG" file format that the Infiray C200 series thermal cameras, P200 series and others use to dump their raw data. The files contain three things: A thermal image with 8 bit resolution with contrast scaled to fit the 0...255 range, a thermal image with 16 bit resolution containing absolute temperature values with 1/16 K resolution, and for some models a JPEG with the image from the low-res visual camera.

Requirements

pillow and numpy

API

Call infiray_irg.load(data) with a bytes object containing the IRG file's contents. It will return a tuple (coarse, fine, vis) of the coarse and fine images as numpy arrays, followed by the visual image as a pillow image. The coarse image has dtype uint8 and contains values from 0 to 255, where 0 is the coldest pixel in the image, and 255 is the hottest. The fine image has dtype float and contains absolute degree Celsius values.

Example

from matplotlib import pyplot as plt
from pathlib import Path

import infiray_irg

coarse, fine, vis = infiray_irg.load(Path('example.irg').read_bytes())

fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(15, 18))

ax1.imshow(coarse)
ax1.set_title('Coarse contrast-maximized')

fine_plt = ax2.imshow(fine)
ax2.set_title('Fine absolute temperatures')
fig.colorbar(fine_plt, ax=ax2, location='right', label='degrees Celsius')

ax3.imshow(vis)
ax3.set_title('Visual')

ax4.hist(fine.flatten(), bins=100)
ax4.set_title('Temperature histogram')
ax4.set_xlabel('degrees Celsius')

fig.tight_layout()
fig.savefig('plot.png')

print('Coldest pixel:', fine.min(), 'C', 'Hottest pixel:', fine.max(), 'C')

Bugs

If you find a bug, or find a file that this library can't load, please send me an email at code@jaseg.de. If your thermal camera isn't supported, please send me an email with one or more example pictures. Please make sure there's something of high contrast visible on these pictures, such as a hot cup of tea.

License

This module is licensed under the MIT license.

Metadata

Release files for infiray-irg 1.6.0

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

Source distribution (sdist)

Source distribution for infiray-irg 1.6.0
File Size Uploaded
infiray_irg-1.6.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for infiray-irg 1.6.0
File Interpreter ABI Platform
infiray_irg-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / infiray_irg-1.6.0.tar.gz

Download URL infiray_irg-1.6.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b0b91c810344d4e55a41e60566f0c6aa53ebf73f547586ed7b109399b2c10129
BLAKE2b-256 checksum
How to use checksums
6de32b2ec20db11321f1c78296e1095a6f7d89347e7d9ab3832a2bd8d0f2544b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / infiray_irg-1.6.0-py3-none-any.whl

Download URL infiray_irg-1.6.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af2b7e490ee86fd131eed2717e0cd991fcebf18d6d6063f8211f49e6d2fe699f
BLAKE2b-256 checksum
How to use checksums
2d03ff4686a2e8e476cf3ea6b1383917ea8eed70f14de96ffcbc783ed328369a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.0.0

2 release files

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