Unsupported image format with raw2hdr

Hello Radiance community,

I’m trying to reproduce an HDR workflow I originally set up in 2020 on Ubuntu, using raw2hdr to process Canon 6D Mark II .CR2 files. Back then the same script ran without issues, but today I get the following error:

raw2hdr -a -e -f -g -h -w -o image.hdr IMG_*.CR2

pimage.c@273>parameter: Unsupported image format '/tmp/raw2hdr.j8uWC5/IMG_1455.tif’

Has anyone else seen this “Unsupported image format” message? Could it be related to a library update or a change in how raw2hdr calls dcraw? Any suggestions for diagnosing or fixing this would be greatly appreciated.

Thanks in advance!

– Guillermo Barrios

Hi Guillermo,

I cannot test it on my machine without the image file, but this might also be related to external dependencies. AFAIK raw2hdr calls dcraw to convert the CR2 to a TIFF, and the dcraw-version may be different than what you had used in 2020. Can you check the exact format of the intermediate TIFF (/tmp/raw2hdr.j8uWC5/IMG_1455.tif), e.g. pixel depth, compression etc.? If there is any exotic features that are not supported by the libtiff raw2hdr was linked to, this could explain the error message.

Best, Lars.

1 Like

Lars,
I tried installing a dcraw version available in 2019, still the same issue.

Using exiftool, i get:
exiftool IMG_1455.tif
ExifTool Version Number : 13.30
File Name : IMG_1455.tif
Directory : .
File Size : 20 MB
File Modification Date/Time : 2025:06:17 15:04:55-06:00
File Access Date/Time : 2025:06:17 15:04:55-06:00
File Inode Change Date/Time : 2025:06:17 15:04:55-06:00
File Permissions : -rw-rw-r–
File Type : TIFF
File Type Extension : tif
MIME Type : image/tiff
Exif Byte Order : Little-endian (Intel, II)
Subfile Type : Full-resolution image
Image Width : 3132
Image Height : 2090
Bits Per Sample : 8 8 8
Compression : Uncompressed
Photometric Interpretation : RGB
Image Description :
Make : Canon
Camera Model Name : EOS 6D Mark II
Strip Offsets : 940
Orientation : Horizontal (normal)
Samples Per Pixel : 3
Rows Per Strip : 2090
Strip Byte Counts : 19637640
X Resolution : 300
Y Resolution : 300
Planar Configuration : Chunky
Resolution Unit : inches
Software : dcraw v9.28
Modify Date : 2020:11:05 01:34:01
Artist :
Exposure Time : 1/4098
F Number : 8.0
ISO : 100
Focal Length : 8.0 mm
User Comment :
Profile CMM Type :
Profile Version : 2.1.0
Profile Class : Display Device Profile
Color Space Data : RGB
Profile Connection Space : XYZ
Profile Date Time : 0000:00:00 00:00:00
Profile File Signature : acsp
Primary Platform : Unknown ()
CMM Flags : Not Embedded, Independent
Device Manufacturer : none
Device Model :
Device Attributes : Reflective, Glossy, Positive, Color
Rendering Intent : Perceptual
Connection Space Illuminant : 0.9642 1 0.82491
Profile Creator :
Profile ID : 0
Profile Copyright : auto-generated by dcraw
Profile Description : sRGB
Media White Point : 0.95045 1 1.08905
Media Black Point : 0 0 0
Red Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
Green Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
Blue Tone Reproduction Curve : (Binary data 14 bytes, use -b option to extract)
Red Matrix Column : 0.43608 0.2225 0.01393
Green Matrix Column : 0.38509 0.71689 0.09709
Blue Matrix Column : 0.14305 0.06061 0.71402
Aperture : 8.0
Image Size : 3132x2090
Megapixels : 6.5
Shutter Speed : 1/4098
Focal Length : 8.0 mm
Light Value : 18.0

I can not see anything strange, and you?

thanks in advance for the help!

Hi Guillermo,

Unfortunately, Dave Coffin’s amazing dcraw.c is no longer maintained, so he hasn’t updated it with support for the latest cameras. Your best option is to download Adobe’s free RAW converter, which produces a standardized DNG (digital negative) format from any camera RAW input. This is kept up-to-date, and works on most computers. Since dcraw supports DNG, it should work for you with raw2hdr.

Hope this helps!
-Greg

P.S. It is unfortunate that camera maker’s have not simply adopted DNG as a standard, which is what it was designed for. They continue to produce new and useless versions of their own RAW formats in hopes of creating a silohed software stack. It’s terribly misguided if you ask me.

1 Like

Dear Greg,

I have tried this method to convert the RAW files to DNG format.
I use the command " raw2hdr -o output.hdr 001.dng 002.dng 003.dng 004.dng 005.dng"
It still output the error "pimage.c@273>parameter: Unsupported image format ‘/tmp/raw2hdr.suE4tg/001.tif’
Also, I have tried use the hdrgen to handle the Tiff format. It output some errors.
Could you please give me some suggestion to solve this problem.

Warm regards,
Joe

What platform are you running on? It seems like your copy of hdrgen may be lacking a TIFF reader module. You should not be getting this error, but maybe you can upload the problem ‘/tmp/raw2hdr.suE4tg/001.tif’ file somewhere that I could take a look at it to make sure there isn’t something funny going on.

-Greg

Greg, many thanks for your prompt and warm reply.
I used the Ubuntu platform.
You can access for Greg check to get these files.
It includes the format of raw, dng and tiff.
Warm regards,
Joe

Hi Greg,
The hdrgen was download from the Anyhere website recently. I used the hdrgen to read the tiff image. The outputs is "hdrgen -o output.hdr crop_011.tiff crop_012.tiff crop_013.tiff crop_014.tiff crop_015.tiff
pimage.c@273>parameter: Unsupported image format ‘crop_011.tiff’
The version of the dcraw is v9.28, but i found that the raw2hdr is based on 8.94.
Should I recode the hdrgen to use the dcraw 9.28?

I have checked the information of the tiff image:
.tiff
Image:
Filename: crop_011.tiff
Permissions: rw-rw-r–
Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 3900x3900+0+0
Resolution: 300x300
Print size: 13x13
Units: PixelsPerInch
Colorspace: sRGB
Type: TrueColor
Endianness: LSB
Depth: 16-bit
Channel depth:
red: 16-bit
green: 16-bit
blue: 16-bit
Channel statistics:
Pixels: 15210000
Red:
min: 520 (0.00793469)
max: 65535 (1)
mean: 3134.42 (0.0478282)
standard deviation: 2604.19 (0.0397374)
kurtosis: 16.4451
skewness: 3.28575
entropy: 0.822073
Green:
min: 0 (0)
max: 57877 (0.883146)
mean: 157.653 (0.00240562)
standard deviation: 1056.68 (0.0161239)
kurtosis: 107.702
skewness: 9.31487
entropy: 0.0570185
Blue:
min: 6891 (0.10515)
max: 65535 (1)
mean: 9273.84 (0.14151)
standard deviation: 2698.19 (0.0411717)
kurtosis: 4.13595
skewness: 1.88206
entropy: 0.842128
Image statistics:
Overall:
min: 0 (0)
max: 65535 (1)
mean: 4188.64 (0.0639145)
standard deviation: 2119.69 (0.0323443)
kurtosis: 0.482006
skewness: 0.958387
entropy: 0.57374
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33,0.03)
green primary: (0.3,0.6,0.1)
blue primary: (0.15,0.06,0.79)
white point: (0.3127,0.329,0.3583)
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 3900x3900+0+0
Dispose: Undefined
Iterations: 0
Compression: None
Orientation: TopLeft
Profiles:
Profile-icc: 476 bytes
Properties:
comment:
date:create: 2025-09-16T03:15:15+00:00
date:modify: 2025-09-16T03:15:15+00:00
date:timestamp: 2025-09-16T03:19:22+00:00
icc:copyright: auto-generated by dcraw
icc:description: sRGB
signature: fef8d026ae5c7ae3fa86985d3b06f3cb8afa80c9317e49bfb9b6c5a2e19025d1
tiff:alpha: unspecified
tiff:endian: lsb
tiff:photometric: RGB
tiff:rows-per-strip: 32
Artifacts:
filename: crop_011.tiff
verbose: true
Tainted: False
Filesize: 87.034MiB
Number pixels: 15.21M
Pixels per second: 55.2099MB
User time: 0.270u
Elapsed time: 0:01.275
Version: ImageMagick 6.9.12-98 Q16 x86_64 18038 https://legacy.imagemagick.org

Hi Joe,

It seems there are two problems with your process. First, dcraw is somehow producing 16-bit/sample TIFF output, when it should be 8-bit/sample. These are the default options in my copy of raw2hdr.pl:

dcraw -c -t 0 -W -g 2 0 -T

This matches what I see in the Linux version of hdrgen_linux.tar.gz on my website. The hdrgen program only accepts 8-bit/sample input. Also, why are your files being named with ‘.tiff’ rather than ‘.tif’, which is what my script writes? Are you renaming them, manually?

The second problem is the one I mentioned, where your copy of hdrgen does not seem to support TIFF input files. I will see if I can recompile with the TIFF library linked. I would like to know what is going on with the first issue, though.

-Greg

P.S. If you run “dcraw” with no arguments, which version number does it report? I am using v9.28.

P.P.S. Does the github release for Ubuntu of hdrgen give you anything different – see here: Release v1.0.1 · radiance-org/hdrgen · GitHub

Dear Greg,

Many thanks for your warm reply.
I used the hdrgen to deal with the files with format of 8-bit and name of .tif (not. tiff).
It still didn’t work.

I think i should double check it tomorrow, and then tell you the results.

Warm regards,
Joe

Hi Joe,

We are working on a more permanent solution by building the github binaries in statically-linked mode. Meanwhile, you can try downloading hdrgen_linux.tar.gz again from my website to see if it works for you. I added TIFF support, though I was not able to support OpenEXR in the included binaries.

Best,
-Greg

OMG! Greg! you are a genius! The updated hdrgen works for me!

Warm regards,
Joe

1 Like