How to get the temperatures and the visible photo out of a FLIR JPG without FLIR Tools
You have a folder of thermal pictures from a FLIR camera and you need the numbers: the temperature of each pixel in a spreadsheet, and the normal photo that the camera took at the same moment. Both are inside the .jpg files already. This guide explains where they are and how to get them out.
What is inside a FLIR JPG
The picture you see when you open the file is an ordinary JPEG: the thermal image already painted with a color palette, with the scale and the logo drawn on top. That picture cannot be turned back into temperatures reliably. The real data sits next to it, in metadata segments of the JPEG that photo apps skip:
- The raw thermal image. One 16-bit number per pixel of the sensor, for example 320 × 240 of them. Depending on the camera it is stored as a 16-bit PNG or as plain 16-bit values. These numbers are sensor readings, not temperatures.
- The camera record. The settings at the moment of capture (emissivity, reflected temperature, object distance, air temperature, humidity) and the calibration constants of that particular camera, called Planck R1, R2, B, F and O.
- The visible photo. On cameras with a second lens, a full normal photo, usually a JPEG and bigger than the thermal image (640 × 480 on an E5 or an AX8, 2592 × 1944 on a T640).
- Extras. The palette, the measurement boxes and spots, and a record that says how the thermal image lines up with the photo.
A file that has all this is called a radiometric JPG. FLIR cameras write the data in several segments that start with the letters FLIR; joined in order they form one block, known as FFF, with a small directory of records.
JPEG picture 320 × 240, what photo apps show
FLIR data block (FFF)
Raw thermal image 320 × 240, 16-bit PNG
Camera record Emissivity 0.95, Planck R1 14144.423, B 1385.5, F 2.5, O -7494, R2 0.027700923
Embedded image 640 × 480 JPEG, the visible photo
Palette, measurements, picture-in-picture alignmentHow raw values become temperatures
The sensor reading of a pixel is the sum of three things: the radiation of the object itself, the surroundings reflected by the object, and the radiation of the air in between. The conversion removes the last two and then turns what is left into a temperature with the camera’s calibration curve:
- Work out how much the air lets through, from the distance, the air temperature and the humidity stored in the file.
- Subtract the reflected part, which depends on the emissivity and the reflected temperature, and the part the air adds.
- Divide by the emissivity and the transmission to get the object’s own signal.
- Apply the Planck curve of the camera backwards:
T = B / ln(R1 / (R2 × (signal + O)) + F), in kelvin.
All the inputs come from the file. That is why two cameras that give the same raw number do not mean the same temperature, and why the result changes if the emissivity set on the camera was wrong for the surface.
One detail trips up many scripts: cameras that store the raw image as a PNG usually write the two bytes of each value in the opposite order to what the PNG format says. Read as it is, the image looks like noise. ThermalUnpack tries both orders and keeps the one that gives a smooth image.
The visible photo
The embedded photo is a complete image file inside the FLIR data block. Extracting it changes nothing: it comes out with the same bytes the camera wrote. Older cameras, such as the FLIR b60 we tested, store a PNG whose three channels hold luminance and color differences instead of red, green and blue; opened as it is, it looks green and pink. ThermalUnpack converts those to normal colors.
Not every file has a photo. Cameras with a single lens cannot store one, and some capture modes leave it out. Of the 8 real files this tool is tested with, 6 have a visible photo.
How we checked the temperatures
- Against FLIR’s software. The author of the Thermimage package published the temperatures that FLIR’s ThermaCAM Researcher Pro exports for one FLIR SC660 image, pixel by pixel. With the same settings, ThermalUnpack differs by 0.03 °C on average and 0.11 °C at most over 307,200 pixels.
- Against the camera’s own readout. A FLIR E5 test image has a measurement box whose minimum, maximum and average the camera printed on the picture: 66.3, 164.6 and 99.8 °F. ThermalUnpack gives the same three numbers for that box.
- Against the scales on the pictures. For the FLIR AX8, T640, SC660 and b60 test images, the values agree with the readouts printed on the images within 0.5 °C. The two FLIR ONE files carry no printed readout to compare with; they use the same code path as the E5 file.
This is a check against published references, not a calibration certificate. ThermalUnpack is not a certified measuring instrument.
Unpack a batch in your browser
Add your FLIR JPGs. ThermalUnpack writes a CSV of temperatures per image, saves the visible photo of each image that has one, and builds a summary.csv with min, max, mean and the settings of every image. Nothing is uploaded. Free for 25 images per batch, $9 once for whole batches.
Unpack my FLIR imagesOther ways to do it
- ExifTool by hand. ExifTool reads the FLIR data block.
exiftool -b -RawThermalImage IMG.jpg > raw.pngsaves the raw thermal image,exiftool -b -EmbeddedImage IMG.jpg > visible.jpgsaves the photo, andexiftool -Emissivity -Planck* IMG.jpgprints the constants. The raw image is still sensor readings: you apply the formula yourself. - Python: FlirImageExtractor. A script that calls ExifTool and does the conversion, with an option to export CSV. Free, and a good base if you want to change the code. You need Python, its packages and ExifTool installed.
- R: Thermimage. A package for thermal image analysis in R that also relies on ExifTool. It lets you recompute with other emissivity or environment values and reads FLIR videos too.
- FLIR Thermal Studio. FLIR’s current desktop program, the successor of FLIR Tools. It edits measurement settings, palettes and reports. The Pro edition is a paid subscription.
FAQ
Can I get temperatures from a screenshot or a thermal picture someone sent me?
Only if the file still has the FLIR data. Chat apps, screenshots and photo editors save a new JPEG without it. Ask for the original file.
Does it work for Seek, HIKMICRO or InfiRay cameras?
No. Those brands store their data in other formats. ThermalUnpack reads radiometric JPGs written by FLIR cameras, and does not read FLIR videos (.seq, .csq).
Can I change the emissivity afterwards?
Not in ThermalUnpack: it uses the values stored in the file and lists them. Thermimage and FLIR Thermal Studio can recompute with other values.
Why is the thermal image smaller than the photo?
Thermal sensors have few pixels: 80 × 60 on a FLIR AX8, 320 × 240 on an E5, 640 × 480 on a T640. The CSV has one value per sensor pixel, not per pixel of the photo.
Sources
- ExifTool’s documentation of FLIR tags, by Phil Harvey: the public reference for the file layout
- Thermimage and ThermimageCalibration, by Glenn Tattersall: the conversion explained, and the comparison data from FLIR’s software used to test this tool
- FlirImageExtractor, whose example images (FLIR ONE, FLIR AX8) are among the real files this tool is tested with