Skip to content

Commit

Permalink
Remove tonemapping on alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
afichet committed Jun 21, 2023
1 parent 526088b commit bbbb7d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tiff-exr/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,11 @@ int main(int argc, char *argv[])

// TODO: double check this does also apply to > 8 bps images...
// in my experiments with RawThreapee, all TIFF are gamma mapped
for (size_t i = 0; i < width * height * spp; i++) {
output_buffer[i] = to_linear_RGB(output_buffer[i]);
for (size_t i = 0; i < width * height; i++) {
// Alpha shall not be touched
for (size_t c = 0; c < std::min(spp, (uint16_t)3); c++) {
output_buffer[spp * i + c] = to_linear_RGB(output_buffer[spp * i + c]);
}
}

try {
Expand Down

0 comments on commit bbbb7d9

Please sign in to comment.