Wednesday, June 24, 2015

HDR and stb_image.h

I just got my renderer where I wanted so I will start outputting hdr.   The simple library I talked about in an earlier post has a minimal but sweet interface for dealing with Radiance .rgbe/.hdr files.   This appears to work fine (reading in a pgm into floats and then cranking them up X10).   Question: on OSX what do people use to view Radiance image files?    I downloaded ximage for OSX but it needs x windows and I am trying to avoid installing X for no good reason (maybe just one of these moments I experience with perfectly good things like X).  Edit: I knuckled under and put X on my mac.   Running ximage from xterm works great.  ximage stands up well for its age!  The stb_image* support for HDR seems to work perfectly!


Vil said...

Hi Pete. I see you've got ximage working now, but in case you're still interested:

Nuke, from The Foundry (where I work) supports HDRs and these days has a free non-commercial version available. It might be overkill if you just want a viewer, but it has all the options you'll ever need for viewing HDR images.

XnViewMP is a decent viewer which can open HDR files, but it doesn't seem to have an easy way to apply gamma correction or tonemapping.

If you're still considering other image formats, then I'd add another recommendation for OpenEXR. OSX has native support for it: it can show a preview of .exr files in the Finder, you can open them in the Preview app and all that. Plus there are some brilliant free VFX-oriented viewers like DJV and JefeCheck which support do OpenEXR but don't support HDR.

Hope some of that helps!

Larry said...

Once again, OIIO can help you here. It's got a halfway decent viewer.

I caution you to avoid .hdr files, in favor of using OpenEXR. HDR is an ancient and primitive format with lots of limitations, which is why nobody uses it for serious work. Among the features of exr that hdr lacks, you'll find: the ability to have more than 3 channels (OMG, how does hdr not even support alpha?), multi-view/stereo/AOV channels, tiles and MIPmapping (both essential to efficient use as textures or environment maps), and support of metadata.

Peter Shirley said...

Thanks folks I will add those to the queue-- I'll be trying all the suggestions eventually! Larry that 3 channel thing is why I stopped using .hdr back in the day so I could add scotopic luminance as a fourth channel, so that limitation is indeed painful for me.

Jono said...

When not using Preview on OSX, which you have to be careful with as it will update files behind your back, I've been using "iv" from OIIO. It can be a bit clunky, but I can trust the whole code path and it uses clear language I understand in its UI. It's the closest thing to PDI's beloved r_view