Image Reader - picture is all grey

Hello everyone,

I am new at KNIME but am enjoying it very much. I got stuck however doing something seemingly very simple. I made a workflow to download satellite images which then need to be processed. Below a download link to one of those images (its a 40mb TIF image).

When you open this image you can see a rather cloudy picture of the Netherlands taken by the Landsat satellite.

Downloading this image using KNIME worked. But when I read this image using the Image Reader (from the KNIME image processing extension) and then look at the image within KNIME, it is completely grey. After doing some research I started experimenting with the different pixel types (in the configure settings). I tried all of them with different results. Either the picture is completely grey, black, or it is a black and white pixel scene that does not look like the original image at all, see an example below.

image

I do not know how to proceed and hope someone more experienced in image processing can help me.

Gr Wouter

1 Like

Dear @WouterH1985,

Welcome to the community!

What you are experiencing is not due to incorrect pixel type detection. What tipped it off for me was the fact that I could see rectangular structures in the image (even with the auto type detection). Those squares were actually 512px*512px which is exactly the tile size of the TIFF file that you are trying to read. Long story short: The TIFF reader of the library that we are using (SCIFIO) doesn’t seem to handle tiled TIFFs all too well.

I was able to open the image with KNIME after converting it to a non-tiled TIFF, however.

Best regards,
Stefan

1 Like

Dear Stefan,

Thank you very much for your reply.

Can you do this tile to non-tile conversion in KNIME or did you use any specialized software? In case you have to go outside of KNIME, would there be a workaround so that I can still create this KNIME workflow that downloads the image, processes it and then saves the result to disk?

Gr Wouter

P.S. Thanks for closing the other topic. I was not happy with the title so I made a new topic and planned to remove the other one. Unfortunately I was not able to (could not find the delete button).

That is currently not possible, I am afraid. I just gave imagemagick a try to see what happens:

convert LC08_L1GT_198023_20210208_20210208_01_RT_B3.tif LC08_L1GT_198023_20210208_20210208_01_RT_B3_untile.tif

By default, it generates untiled TIFF files that can be opened in KNIME. You can use the External Tool node to trigger this conversion on the command line as well, so that you have everything in one workflow.

Thanks Stefan, I will give that a try.

It did make me wonder however, will this conversion to an untiled image have any consequences when it comes to further processing? One processing step will to stack several images (each image is a specific band), and another processing step will be to combine two tiles (which will now be untiled) together (like you would with 2 pieces of a puzzle).

Kind regards,

Wouter

This will work just fine (given you have a workstation with enough memory).

What exactly do you mean by “tile” here? Is one “tile” an entire image like the one that you have shared or are you really talking about a specific (512px*512px) region of such an image? The tiling that you are removing by the conversion really is a feature of the TIFF format and is not content-aware as far as I know.

What exactly do you mean by “tile” here? Is one “tile” an entire image like the one that you have shared or are you really talking about a specific (512px*512px) region of such an image? The tiling that you are removing by the conversion really is a feature of the TIFF format and is not content-aware as far as I know.

With one “tile” I indeed mean the entire image. In one image you see the southern part of the Netherlands, and in another image the northern part. I want to combine the two (make a bigger image) so you can see the Netherlands as a whole. Do you think that removing the tiling in both images in the conversion somehow can affect this step?

No, removing the tiling should not influence the underlying pixel values.

Dear Stefan,

Thank you so much for your help. I don’t think I could have solved it by myself, so it is very much appreciated.

Kind regards,

Wouter

1 Like