Hydra 4: Beautiful HDR Imaging for Mac

Creaceed
7 min readAug 11, 2016

Here it is! Hydra 4, a major update to our high dynamic range (HDR) app for the Mac.

We’ve been busy with Hydra 4 over the last year, this is a major rewrite from Hydra 3. Not only the interface is new, but also the whole image processing architecture, which is now built on top of Metal.

Hydra 4 — Develop Mode. World Scenery Photography by Sébastien Degardin.

Metal

The new image processing core of Hydra is Metal-based. Metal is Apple’s new API for modern GPU processing on Mac & iOS. We wanted to modernize our processing architecture from previous OpenGL / CPU code to use pure Metal instead, with the goal of offering maximum rendering & display performance and also to make it future proof.

Metal : Modern GPU Programming Interface designed by Apple.

GPU APIs are complex, but the Metal one is beautifully designed and gives precise control of what happens at which moment, with predictable performance. More control also means you get more responsibilities, like handling the contents of memory buffers sent to the GPUs, as well as the moment when you want to read back from its memory and syncing with other tasks. We decided to build our image processing APIs as a thin abstraction layer that let us easily target other APIs like OpenGL and still provide compatibility with older hardware.

About performance: Metal appears to be really fast. Depending on which subsystem we tested (merging, display, tone mapping) and the hardware we used (discrete vs. integrated GPUs), we could observe 1.5 to 3.0x performance improvements over OpenGL.

Scoped settings specific fine-tuning

New Tone Mapper

Like with previous versions of Hydra, we opted for a tone mapper that wouldn’t exaggerate HDR effects and instead focus on natural looks as the primary target.

It’s the first version of our tone mapper that performs all computations on the GPU. Our goal was to avoid the small pauses (typically 500ms to 1s) that were needed to compute the full-size preview, as those made the editing experience less accurate and less enjoyable. We wanted full-size scrolling and image editing at full speed that is identical to the rendered output.

The new merging and tone mapping workflow uses a 128-bit pipeline internally to preserve all the details from the input pictures.

Hydra Projects: a Hybrid Document Model

Hydra is a document-based app, its documents are the projects you create to edit your photos. But unlike text-based or other image-based documents, Hydra documents are more ephemeral by nature. Users typically have an HDR project, work on it for some time, but then what matters is the rendered image. We considered removing the document part of it, but an editing session can last for more than a couple hours, on multiple projects, and re-editing after a few days should be possible too. But the file-based approach of document-based apps that show an open panel is a bit awkward here, and it does not suit very well this workflow.

For these reasons, we opted for a document-based app where documents (projects) are mostly managed by the app, with optional names. These “internal” projects are stored within the app sandbox. Finder interactions are mostly removed (no more open panel), and this makes the experience more straightforward. We still wanted a way to allow saving projects anywhere in the file system, we qualify them as “reference” project type, for the case where it makes sense: a valuable project that you want to archive because you know you’ll be working on it again at later time.

Projects listing in Hydra 4

So Hydra uses a hybrid concept of being both a shoebox app and a document-based app at the same time to better handle its specific workflow.

Improved Alignment & Ghost Tools

Making an HDR image typically requires that you capture a number of different exposures of the same scene with difference camera settings. When a tripod is not used, it means some camera motion occurs between shots that needs to be compensated.

Hydra lets you align images against the reference image (typically, the middle exposure), by letting you locate a number of reference points that need to be matched through images. These points then allow computing of a homography to transform each image accordingly [note: 4 point fully define the homography, but they should be well chosen to cover the whole whole image and *not* be colinear].

What’s new in this version of Hydra is that alignment points can be chosen per image and are not required to be the same across each image. This makes it better suited for the cases when large EV difference make an image too dark at specific areas to locate the alignment point. Other differences with previous version is that the alignment interface is now embedded full-size in the image content with new improved rendering modes to assert precise edge matching. The red & blue technique for instance show edges of one image in red, and the other image in blue, which, when perfectly aligned, will blend to white.

Red / blue augmented display to align images precisely.

Moving subjects in a scene will typically appear differently in the multiple exposures required to make an HDR image. This creates ghost artifacts if not handled properly. Hydra offers a ghost removal tool that lets you delineate regions of the image where motion occurs. For each of these regions, the user can determine which image or images contribute to the final image. For instance, if some people are moving in dark part of the image, you can delineate that region and pick the brightest image (which is the best one for dark subjects) as the only one that contributes to the final merge in that region, avoid all ghosting artifacts.

Hydra lets you preview the merged image (the one that has the full light dynamics) at different exposure levels before moving to the tone mapper, to make sure ghosts are well handled.

Great support for recent Mac hardware, and advanced options.

Latest advancement in display technology on iMacs and iPad are remarkable. Hydra offers custom color processing chain implemented with shaders on the GPU that enables support for Wide & Deep Colors, and make great use of those gorgeous displays.

Hydra works internally with ACES CG Linear color space, 128-bit per pixel, to offer compatibility with most possible output constraints, including display and custom output color spaces.

Another interesting option that is available in this new version of Hydra is rendering the final image without tone mapping applied to it, in a file format that keeps the entire dynamic range of the input images. Hydra proposes both OpenEXR and Radiance file formats which allow 32 bit / component exports (floating point), which in turn will let you apply a tone mapper of another app or at a later time, when technology gets more advanced. Hydra also supports those formats as input.

Export formats, including OpenEXR and Radiance.

Integration with other apps, including Apple Photos

Finally, we wanted to offer great integration with the OS and other apps. Hydra will let you export final images to many formats & color spaces, and to various OS-supported destinations (like social networks, messaging apps, etc).

Apple Photos workflow: select images, then send to Hydra

One particular workflow is to export an exposure set from Apple Photos to Hydra, process it, and import the result back into Photos for archiving. This is made possible thanks to Hydra implementing a “share” extension.

The reason we opted for a “share” extension instead of a “photos” extension is that only the “share” extensions allow sending multiple images from Photos to another app. That makes more sense for an HDR app whose purpose is to merge multiple exposures. And that should be available to other apps as well, not only Apple Photos, as this is based on standard OS features.

More Information about Hydra

You can find more information about Hydra on our website, or have a look at Hydra 4 Trailer below.

Hydra 4 Video Trailer

Thank you for reading!

Writing by @rsebbe

--

--

Creaceed

Making apps for Mac, iPhone, & iPad since 2008. Belgium.