Please forgive me as I am new to GMIC but I am loving it so far.
I am using the command line and I have two images, I have calculated the displacement field between them and have warped one image according to the displacement field and when the preview pops up I can see both images, the displacement and the successful warp.
I am trying to output both the displacement field and the warped image as a tiff using -output image.tiff but the results are always a blank white tiff.
Can anyone please help get the resulted warped image into a lovely usable tiff?
@fernando Welcome to the forum and G’MIC. The most helpful thing you can do is share an example file and command. (G’MIC version, where you got it and OS won’t hurt either.) From what you have said, I am guessing there are two things going on.
The preview is normalizing the images. Use CTRL+n to toggle between states. Most likely, the image is white because
1 It is rounded off or clipped to the highest value that the file format can hold or settings allow.
2 Your image viewer cannot interpret the file format (e.g., bit depth) and display it.
This .tiff output issue is something people have encountered a lot.
Most of the time, the issue is related to the fact that many image viewers do not manage float-valued.tiff (but only integer-valued), which is the default .tiff format that G’MIC outputs (as G’MIC is working with float-valued images). Or they only manage to read .tiff files with values in range [0,1]. There are actually no such limitations in the .tiff file format, and G’MIC outputs exactly the image values he has (including nan or inf for instance).
So, I would suggest the following steps:
Try first to normalize your image in range [0,1] before saving it as a .tiff file in G’MIC (adding command normalize 0,1 before output). And see if your image viewer can read it this way.
If it doesn’t work, then maybe your image viewer is not tolerant to float-valued images, and in this case, you have to tell G’MIC saving the .tiff in uchar (8bits integers) or ushort (16bits integers) types. You can try to normalize your data, then output it like this: