#13 Possible issue w/ gm convert 'tile' function

closed
nobody
5
2012-10-28
2012-10-28
Stoermer
No

Hello:
Thanks for this great utility. I have the latest version compiled with libtif4 in order to read 32 bit ieee floating point single band (gray) files.

This works perfectly and I am able to read and write the 32 bit tifs.. the problem I have is when I try and join two 32 bit ieee single band files, the resulting tif is tiled correctly but is converted to RGB. I've tried various command line switches to force a single band result.

Am I missing something? This seems possible as the results are tiled properly, but they are 3 band tif RGB.. not single band gray with 32 bit ieee data. Thank you again

--

I can post examples if needed.

Discussion

    • labels: --> File Format Support
     
  • GraphicsMagick does not currently record the many details of the input TIFF and use these details to output the exact same TIFF subformat. Instead it attempts to write a best-fit "baseline" TIFF file that most software can read. This is unfortunate but it is too difficult to provide a suitable user interface for it outside of a TIFF-specific tool.

    The only workaround is to check the input TIFF format and use the -define option to request the detailed options necessary to create the desired TIFF subformat. For example '-define tiff:sample-format=ieeefp -define tiff:bits-per-sample=32'' will write a TIFF with 32-bit floating point values rather than integer. If the image was grayscale and is somehow being output as three-channel RGB, then you could specify '-type grayscale' so that the output file uses minisblack photometric. Doing so may cause a Rec.601 transform to be used to convert RGB to gray if the image is not already believed to be gray.

     
  • Stoermer
    Stoermer
    2012-10-28

    Thank you for your prompt reply. I will test with the '-type grayscale' to force the single band gray. I was sure I had tried this already. I am using the recommended 'define' syntax on the command line and I can read/write 32 bit tif no problem. When I use the gm convert 'tile' function is when it switches to RGB. I will try and few tests and post the results. Thx

     
  • For the sake of performance, modern GraphicsMagick does not normally inspect all the pixels to see if they are gray. It may be that -tile is not correctly intuiting that the result is already gray. If you specify '-type optimize' then it will perform these checks and will take a bit longer to write the file if the pixels are all gray (because it has to test all the pixels).

     
  • Stoermer
    Stoermer
    2012-10-28

    thank you, -type optimize did the trick

     
  • Stoermer
    Stoermer
    2012-10-28

    • status: open --> closed