when i open a 16 bit image in tiff format, it opens up as a black image. The 16-bit tiff image only opens in the program ImageJ; however, it does not open in Preview. I am wondering what my options are now to view the format in an easier way that does not reduce the resolution than to open ImageJ to view it. Should I convert it to an 8-bit format, but wouldn't I lose data when the format is reduced from 16 to 8 bit? Also, I was thinking about converting the tiff image to jpeg, but would that result in a reduction in resolution?
2 Answers
From the ImageJ wiki's Troubleshooting page:
This problem can arise when 12-bit, 14-bit or 16-bit images are loaded into ImageJ without autoscaling. In that case, the display is scaled to the full 16-bit range (0 - 65535 intensity values), even though the actual data values typically span a much smaller range. For example, on a 12-bit camera, the largest possible intensity value is 4095—but with 0 mapped to black and 65535 mapped to white, 4095 ends up (linearly) mapped to a very very dark gray, nearly invisible to the human eye.
You can fix this by clicking on Image ▶ Adjust ▶ Brightness/Contrast... and hitting the Auto button.
You can verify whether the actual data is there by moving the mouse over the image, and looking at the pixel probe output in the status bar area of the main ImageJ window.
In other words, it is unlikely that your image is actually all 0 values, but rather the display range is probably not set to align with the data range. If your image has intensity values ranging from e.g. 67 to 520, but stored as a 16-bit image (with potential values ranging from 0 to 65535), the default display range is also 0=black, 65535=white, and values in between scaled linearly. So all those values (57 to 520) will appear near black. When you autoscale, it resets the display range to match the data range, making values 67 and below appear black, values 520 and above appear white, and everything in between scaled linearly.
If you use the Bio-Formats plugin to import your images into ImageJ, you can check the "Autoscale" option to ensure this dynamic display range scaling happens automatically.
As for whether to convert to JPEG: JPEG is a lossy compression format, which has its own problems. If you are going to do any quantitative analysis at all, I strongly advise not converting to JPEG. See the Fiji wiki's article on JPEG for more details.
Similarly, converting to 8-bit is fine if you want to merely visualize in another application, but it would generally be wrong to perform quantitative analysis on the down-converted image. Note that when ImageJ converts a 16-bit image as 8-bit (using the Image > Type menu), it "burns in" whatever display range mapping you currently have set in the Brightness/Contrast dialog, making the apparent pixel values into the actual 8-bit pixel values.

- 6,751
- 3
- 37
- 69
-
I tried doing Image>Adjust>Brightness/Contrast... and hitting the Auto button but when i save the image as a tiff file, it still appears as a black file on my desktop. Am i doing something wrong here? – user1911720 Dec 19 '12 at 04:37
-
to ctrueden and @medPhys-pl, i am wondering if there are other ways to see the file than to open ImageJ every time to view the images. Is this my only option because I am not able to see the images in the Preview app? Thank you. – user1911720 Dec 19 '12 at 04:47
-
The Image > Type menu controls the bit depth of your image. If you want to save as 8-bit TIFF (and thus "burn in" the display range scaling, so that the image appears visible in software such as Preview), you will need to run Image > Type > 8-bit to convert to 8-bit before saving as TIFF. Otherwise, you will be saving as 16-bit TIFF again, and back where you started. I agree that repeating this process manually for every TIFF would be very time consuming. Fortunately, ImageJ has the Process > Batch > Convert command to convert images en masse. – ctrueden Dec 19 '12 at 15:58
-
would it be okay to save the image in 8-bit format after doing the Auto brightness/contrast? or is this not advisable? what i mean is, would i lose anything? – user1911720 Dec 19 '12 at 16:03
-
Yes, you would lose information by saving to 8-bit format. However, 8-bit TIFFs are supported by more software packages, so if your goal is to e.g. embed the picture in a PowerPoint presentation, it would make sense to convert to 8-bit TIFF first (since in this case, you are doing it for visualization purposes only). But you should not convert to 8-bit TIFF and then attempt any sort of quantitative analysis. Use the original 16-bit data for that. – ctrueden Dec 20 '12 at 19:46
-
You can use my tiff loader which should load it.https://github.com/MalcolmMcLean/tiffloader Saving as a PNG is lossless in resolution but you still only get 8-bit channels. TIFF is designed for high quality images. – Malcolm McLean Mar 20 '17 at 20:07
Changing from a 16 bit image to an 8 bit image would potentially reduce the contrast but not necessarily the resolution. A reduction in resolution would come from changing the number of pixels. To convert 16bit to 8bit the number of pixels would be the same but the bit depth would change.
The maximum pixel value in a 16 bit unsigned grayscale image would be 2^16-1
The maximum pixel value in an 8 bit unsigned grayscale image would be 2^8-1
One case where the resolution would be affected is if you had a 16 bit image with a bunch of pixels of pixel value x
and another bunch of pixels with pixel values x + 1
and converting to an 8 bit image mapped the pixels to the same value 'y' then you would not be able to resolve the two sets of pixels.
If you look at the maximum and minimum pixel values you may well be able to convert to an 8 bit image without loosing any data.
You could perform the conversion and check using various metrics if the information in the 8bit image is reduced. One such metric would be the entropy. This quantity should be the same if you have not lost any data. Note that the converse is not necessarily true i.e. just because the entropy is the same does not mean the data is the same.
If you want some more suggestions on how to validate the conversion and to see if you have lost any data let me know.

- 2,988
- 6
- 30
- 55
-
How do i measure the "entropy" on ImageJ? Are there other ways to see if data has been lost between the conversion from 16 to 8 bit? – user1911720 Dec 19 '12 at 04:39
-
also, the 16-bit's max/min pixel values were 19 and 92, but when i changed the image type to an 8-bit, the min/max changed to 0 and 253. Doesn't this mean that i lost data? – user1911720 Dec 19 '12 at 05:02
-
For measuring the entropy of an image see this http://www.mathworks.co.uk/help/images/ref/entropy.html . You could write a litle code in ImageJ to implement this algorithm. If you have only got 92-19 = 73 pixels values you could definitely convert to 8 bit without loosing any data using a suitable algorithm. It's still not clear to me that you have to convert the image. Follow ctreudens advice on adjusting the brightness and contrast. Why can't you use ImageJ to view the Image and do your analysis? – Codey McCodeface Dec 19 '12 at 09:43
-
well, there's around 50 images, and the researcher wants to compare the images in a slideshow/preview format than having to open imagej because that is somewhat cumbersome for 50 images. – user1911720 Dec 19 '12 at 15:01
-
You can open multiple images as a stack in ImageJ. They would have to have the same width and height. If the pixel values are very different then you may have to change it on a per image basis. – Codey McCodeface Dec 19 '12 at 18:28
-
@user1911720: If your 16-bit data's min/max range is 19-92, then you would lose nothing converting to 8-bit. But I suggest first setting the displayed min/max to 0-255 in the Brightness & Contrast dialog before converting to 8-bit. That way your pixel values will remain unchanged (i.e., a 19 will stay a 19, etc.). The reason they changed to 0-253 is because you had autoscaled 19 to black and 92 to white using B&C, and then when converting to 8-bit it sets black=0 and white=255(ish). In other words, it "burned in" the *displayed* pixels as the actual pixel *values* when you converted down. – ctrueden Dec 20 '12 at 19:48
-
@ctrueden how would i set the displayed min/max to 0-255 because when i opened the Brightness Contrast dialog box, I am not able to move the minimum past 19 and the maximum past 92. Thank you – user1911720 Dec 22 '12 at 15:16
-
@ctrueden would it be okay to perform quantitative analysis on this 8-bit image since nothing has been lost? – user1911720 Dec 22 '12 at 15:17
-
@user1911720: The "Set" button in the Brightness & Contrast dialog lets you explicitly type in the min/max. And yes, I think it is safe to quantitatively analyze the 8-bit version of the image, since no data was altered in this case. But unfortunately the solution won't generalize to other situations where you have 16-bit data with a dynamic range beyond 0-255. – ctrueden Jan 20 '13 at 04:51