commit 674593823e865a74874a4b541c0b8931d712262a
parent 2b15a44864f5e10c61d96c5aea498d0282d3f4a2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 6 Dec 2019 15:23:45 +0100
Merge branch 'release_0.2.1'
Diffstat:
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
@@ -29,6 +29,13 @@ informations on CMake.
## Release notes
+### Version 0.2.1
+
+- Update how the image exposure is handled: the pixels are multiplied by
+ the exposure priorly to their tone mapping. Previously, it was the tone
+ mapped pixels that were multiplied by the exposure.
+- Fix the man page that wrongly described the tone mapping operator.
+
### Version 0.2
- Fix the XYZ to sRGB conversion: the reference white was not correctly set.
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -36,7 +36,7 @@ include_directories(${RSys_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
################################################################################
set(VERSION_MAJOR 0)
set(VERSION_MINOR 2)
-set(VERSION_PATCH 0)
+set(VERSION_PATCH 1)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
configure_file(${HTPP_SOURCE_DIR}/htpp_version.h.in
diff --git a/doc/htpp.1.txt b/doc/htpp.1.txt
@@ -35,7 +35,7 @@ standard input.
*htpp* tone maps the high dynamic range colors of the _input_ image with the
following filmic tone mapping operator [2]:
- out-color = f(in-color) / white-scale * exposure
+ out-color = f(in-color * exposure) / f(white-scale)
with:
diff --git a/src/htpp.c b/src/htpp.c
@@ -277,9 +277,9 @@ filmic_tone_mapping(double pixel[3], const double exposure, const double Ymax)
const double white_scale = TONE_MAP(W);
ASSERT(pixel);
- pixel[0] = TONE_MAP(pixel[0]) / white_scale * exposure;
- pixel[1] = TONE_MAP(pixel[1]) / white_scale * exposure;
- pixel[2] = TONE_MAP(pixel[2]) / white_scale * exposure;
+ pixel[0] = TONE_MAP(pixel[0]*exposure) / white_scale;
+ pixel[1] = TONE_MAP(pixel[1]*exposure) / white_scale;
+ pixel[2] = TONE_MAP(pixel[2]*exposure) / white_scale;
#undef TONE_MAP
return pixel;
}
@@ -568,10 +568,10 @@ main(int argc, char** argv)
double* row = (double*)(img.pixels + img.pitch*y);
double* pixel = row + x*3;
- filmic_tone_mapping(pixel, args.exposure, Ymax); /* Tone map the RGB pixel */
+ filmic_tone_mapping(pixel, args.exposure, Ymax); /* Tone map the XYZ pixel */
if(args.pixdata == PIXEL_RADIANCE) {
XYZ_to_sRGB(pixel); /* Convert in RGB color space */
- sRGB_gamma_correct(pixel); /* Convert in sRGB color space (i.e. gamma correction) */
+ sRGB_gamma_correct(pixel); /* Gamma correction */
}
}