Skip to content
Snippets Groups Projects
Commit 53a028c3 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add log message when mapping to 8 bit

parent fbccd31e
No related branches found
No related tags found
No related merge requests found
...@@ -526,14 +526,18 @@ function mapTo8bitPreservingSaturation(effectiveBits) { ...@@ -526,14 +526,18 @@ function mapTo8bitPreservingSaturation(effectiveBits) {
// range was adjusted to the min/max values of the image (resulting in // range was adjusted to the min/max values of the image (resulting in
// over-saturation of wrongly mapped pixels) // over-saturation of wrongly mapped pixels)
if (effectiveBits == 16) { if (effectiveBits == 16) {
run("Divide...", "value=257.50 stack"); divisor = 257.50;
} else if (effectiveBits == 12) { } else if (effectiveBits == 12) {
run("Divide...", "value=16.09 stack"); divisor = 16.09;
} else { } else {
print("Unsupported VALUE range detected: " + effectiveBits + " bits"); print("Unsupported VALUE range detected: " + effectiveBits + " bits");
print("Input image needs to have a value range of 8, 12 or 16 bits!"); print("Input image needs to have a value range of 8, 12 or 16 bits!");
exit_show(); exit_show();
} }
msg = "mapping " + effectiveBits + " bit value range to 8 bit";
msg = msg + " (dividing pixel values by " + divisor + ")";
logd(msg);
run("Divide...", "value=" + divisor + " stack");
run("8-bit"); run("8-bit");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment