Difference between revisions of "16bit workflow with hugin"

From PanoTools.org Wiki
Jump to navigation Jump to search
m (link capitalisation fix)
 
(15 intermediate revisions by 3 users not shown)
Line 14: Line 14:
 
converting [[RAW]] data to 16bit colour depth as RAW images are typically only 12bit in the
 
converting [[RAW]] data to 16bit colour depth as RAW images are typically only 12bit in the
 
first place.  If you need a greater [[dynamic range]] than found in RAW images, it is possible
 
first place.  If you need a greater [[dynamic range]] than found in RAW images, it is possible
to combine bracketed exposures in a [[HDR workflow with hugin]].
+
to combine [[Bracketing|bracketed]] exposures in a [[HDR workflow with hugin]].
  
 
These [[PPM]] files are not readable by [[hugin]] or [[nona]], so the next step is to use
 
These [[PPM]] files are not readable by [[hugin]] or [[nona]], so the next step is to use
Line 24: Line 24:
  
 
Note that I rotated them at the same time since these are [[portrait]] shots.
 
Note that I rotated them at the same time since these are [[portrait]] shots.
Gamma correction is also applied at this stage since [[RAW]] data is generally linear
+
[[Gamma]] correction is also applied at this stage since [[RAW]] data is generally linear
and difficult to view without colour profile management (not yet supported by [[hugin]]).
+
and difficult to view without [[colour profile]] management (not yet supported by [[hugin]]).
  
 
You can now delete the intermediate [[PPM]] files.
 
You can now delete the intermediate [[PPM]] files.
Line 31: Line 31:
 
Alternatively [[UFRaw]] can be used for the entire conversion from [[RAW]].
 
Alternatively [[UFRaw]] can be used for the entire conversion from [[RAW]].
  
If necessary, correct [[chromatic aberration]] and [[vignetting]] with [[fulla]] at this stage.
+
If necessary, correct [[chromatic aberration]] with [[fulla]] at this stage.
  
 
== Stitching with hugin ==
 
== Stitching with hugin ==
Line 37: Line 37:
 
The [[TIFF]] images can be loaded into [[hugin]] as per usual except:
 
The [[TIFF]] images can be loaded into [[hugin]] as per usual except:
  
Information about the [[field of view]] was lost during the [[PPM]] stage, so this will need to be re-entered manually or re-optimised with [[PTOptimizer]].
+
[[EXIF]] information about the [[Field of View]] was lost during the [[PPM]] stage, so the field of view will need to be re-entered manually, re-optimised with [[PTOptimizer]] or transferred from the RAW file using [[exiftool]]:
  
[[autopano-sift]] currently only supports 8bit per channel images, so if
+
  exiftool -tagsfromfile DSCN3088.nef -overwrite_original_in_place -exif:all DSCN3088.tif
you want to use this tool then you need to create temporary 8bit versions of each
 
image, generate control-points and then replace the images with the full version. Create
 
the 8bit files by adding ''-depth 8'' to the ''convert'' command-line above.
 
  
 
Stitch the images as per usual into a [[TIFF]] file, you can use [[enblend]] as the
 
Stitch the images as per usual into a [[TIFF]] file, you can use [[enblend]] as the
 
final step.
 
final step.
 +
 +
If you are working with linear ([[gamma]] = 1) data, then you should apply a gamma of 2.2 on the
 +
remapped images after stitching with nona but before running [[enblend]]:
 +
 +
  mogrify -gamma 2.2 myproject_*.tif
  
 
== Post processing ==
 
== Post processing ==
  
 
This [[TIFF]] file is in 16bit per channel RGBA format, which is not viewable in most image
 
This [[TIFF]] file is in 16bit per channel RGBA format, which is not viewable in most image
viewers or web-browsers, so there is an extra step to create portable images.
+
viewers or web-browsers, so there is an extra step needed to create portable images:
Open the file in a 16bit aware image editor such as [[cinepaint]] or [[krita]], tweak the
+
 
 +
Open the file in a 16bit aware image editor such as [[GIMP]] or [[Krita]], tweak the
 
colours, retouch or apply a [http://www.luminous-landscape.com/tutorials/contrast_masking.shtml contrast mask]
 
colours, retouch or apply a [http://www.luminous-landscape.com/tutorials/contrast_masking.shtml contrast mask]
 
and finally save in an 8bit per channel format such as [[JPEG]].
 
and finally save in an 8bit per channel format such as [[JPEG]].
  
[[Category:Tutorial]][[Category:Tutorial:Specialised]]
+
Alternatively you can get very good results by simply applying the ICC [[colour profile]]
 +
for your camera and converting to sRGB colour-space, [[w:Little CMS|lcms]] provides the tifficc tool
 +
for doing just this:
 +
 
 +
  tifficc -i mycamera.icm myproject.tif output.tif
 +
 
 +
[[Category:Tutorial:Specialised]]
 +
[[Category:Software:Hugin]]

Latest revision as of 11:54, 22 November 2022

This tutorial doesn't cover reasons why you might want to shoot with RAW and stitch in 16bit format. It is a simple HOWTO listing the tools available and how to use them with hugin.

Preparing the 16bit images

Start by using dcraw to read the RAW files and batch convert them into portable 16bit per channel PPM files. RAW pictures from my Nikon 8700 have a .nef extension, so the command looks something like this:

 dcraw -v -w -4 dscn*.nef

Note that although hugin, nona and enblend support HDR floating-point data, there is no real loss converting RAW data to 16bit colour depth as RAW images are typically only 12bit in the first place. If you need a greater dynamic range than found in RAW images, it is possible to combine bracketed exposures in a HDR workflow with hugin.

These PPM files are not readable by hugin or nona, so the next step is to use ImageMagick to create 16bit per channel TIFF files:

 convert -rotate 270 -gamma 2.2 dscn3088.ppm dscn3088.tif
 convert -rotate 270 -gamma 2.2 dscn3089.ppm dscn3089.tif
 ...

Note that I rotated them at the same time since these are portrait shots. Gamma correction is also applied at this stage since RAW data is generally linear and difficult to view without colour profile management (not yet supported by hugin).

You can now delete the intermediate PPM files.

Alternatively UFRaw can be used for the entire conversion from RAW.

If necessary, correct chromatic aberration with fulla at this stage.

Stitching with hugin

The TIFF images can be loaded into hugin as per usual except:

EXIF information about the Field of View was lost during the PPM stage, so the field of view will need to be re-entered manually, re-optimised with PTOptimizer or transferred from the RAW file using exiftool:

 exiftool -tagsfromfile DSCN3088.nef -overwrite_original_in_place -exif:all DSCN3088.tif

Stitch the images as per usual into a TIFF file, you can use enblend as the final step.

If you are working with linear (gamma = 1) data, then you should apply a gamma of 2.2 on the remapped images after stitching with nona but before running enblend:

 mogrify -gamma 2.2 myproject_*.tif

Post processing

This TIFF file is in 16bit per channel RGBA format, which is not viewable in most image viewers or web-browsers, so there is an extra step needed to create portable images:

Open the file in a 16bit aware image editor such as GIMP or Krita, tweak the colours, retouch or apply a contrast mask and finally save in an 8bit per channel format such as JPEG.

Alternatively you can get very good results by simply applying the ICC colour profile for your camera and converting to sRGB colour-space, lcms provides the tifficc tool for doing just this:

 tifficc -i mycamera.icm myproject.tif output.tif