I'm trying to put together a batch process to convert these TIFFs into JPGs. Many graphics programs (including GM apparently) can't display them properly, though a piece of software called ImageJ can. Here is the TIFF info from a sample file:
gm display shows this as a correctly-sized, but totally blank image. I've tried rebuilding with the -with-quantum-depth=16 and 32 options, but still get the same results.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suggest trying with a GM configured with -with-quantum-depth=16. Then try the -normalize option to see if it makes the image look like you see with ImageJ. If using -normalize "fixes" the problem, then the issue is that the image is 16-bit TIFF but the data is only encoded with very small values such as a range of 0 - 255. This causes the image to appear as totally black when really there is data present.
I have seen these sort of images before and they usually come from scientific CCD cameras.
If you have libtiff's 'tiffinfo' available, then please provide the output of 'tiffinfo filename'.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BFriesen - that's exactly the situation - we're using scientific CCD cams, and the converted images appear solid black. The tiffinfo output is in my first comment. I tried using -with-quantum-depth=32 and that did *not* have any effect, but I haven't tried the -normalize switch. Thanks for your advice.
Will the -normalize switch also help in converting the images to JPG format, or just in displaying them natively?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much for the help and advise here! Everything is working exactly as you say it should, and the multiply operator should help us very much to optimize the quality of the images we're producing. Much obliged!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to put together a batch process to convert these TIFFs into JPGs. Many graphics programs (including GM apparently) can't display them properly, though a piece of software called ImageJ can. Here is the TIFF info from a sample file:
TIFF Directory at offset 0x99d948 (10082632)
Image Width: 2452 Image Length: 2056
Resolution: 300, 300 pixels/inch
Bits/Sample: 16
Sample Format: unsigned integer
Compression Scheme: None
Photometric Interpretation: min-is-black
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 1
Planar Configuration: single image plane
gm display shows this as a correctly-sized, but totally blank image. I've tried rebuilding with the -with-quantum-depth=16 and 32 options, but still get the same results.
Also - graphicsmagick seems to be (incorrectly?) identifying the TIFF as 8-bit - could this be the problem?
$ gm identify test.tif
test.tif TIFF 2452x2056+0+0 DirectClass 8-bit 9.6M 0.000u 0:01
More detailed (and contradictory) info from graphicsmagick:
$ gm identify -verbose test.tif
Image: test.tif
Format: TIFF (Tagged Image File Format)
Geometry: 2452x2056
Class: DirectClass
Type: grayscale
Depth: 1 bits-per-pixel component
Channel Depths:
Gray: 1 bits
Channel Statistics:
Gray:
Minimum: 0.00 (0.0000)
Maximum: 0.00 (0.0000)
Mean: 0.00 (0.0000)
Standard Deviation: 0.00 (0.0000)
Resolution: 300x300 pixels/inch
Filesize: 9.6M
Interlace: No
Orientation: TopLeft
Background Color: white
Border Color: #DFDFDF
Matte Color: #BDBDBD
Compose: Over
Dispose: Undefined
Iterations: 0
Compression: No
Timestamp: 0000:75:00 00:127:20
I suggest trying with a GM configured with -with-quantum-depth=16. Then try the -normalize option to see if it makes the image look like you see with ImageJ. If using -normalize "fixes" the problem, then the issue is that the image is 16-bit TIFF but the data is only encoded with very small values such as a range of 0 - 255. This causes the image to appear as totally black when really there is data present.
I have seen these sort of images before and they usually come from scientific CCD cameras.
If you have libtiff's 'tiffinfo' available, then please provide the output of 'tiffinfo filename'.
BFriesen - that's exactly the situation - we're using scientific CCD cams, and the converted images appear solid black. The tiffinfo output is in my first comment. I tried using -with-quantum-depth=32 and that did *not* have any effect, but I haven't tried the -normalize switch. Thanks for your advice.
Will the -normalize switch also help in converting the images to JPG format, or just in displaying them natively?
I thought so. I have heard before that ImageJ tries to be helpful by automatically scaling the image so that you are not really seeing the real image.
You should be able to do
gm convert infile.tiff -nomalize outfile.jpg
You can also do more precise linear scaling using something like
gm convert infile.tiff -operator all Multiply 256 outfile.jpg
The exact multiplication factor needed is likely image dependent.
Bob
Thank you very much for the help and advise here! Everything is working exactly as you say it should, and the multiply operator should help us very much to optimize the quality of the images we're producing. Much obliged!