Save Image as JPG ends up in grayscale instead of RGB

Hi,
I have 16-bit images with 3 channels, which I converted to 8-bit. Within KNIME everything looks nice but when I use the Image Writer to save them as RGB-Jpg, I only get a grayscale Jpg.
Can anybody explain the issue? I have no idea why it is not working. Here is a workflow to reproduce the issue:
export_as_rgb_image.knwf (91.7 KB)

Best,
Antje

I think you have to name the channel dimension Channel (instead of C in your images) for the Image Writer to recognize it.

See also the dropdown in the Dimension Mapping tab of the Image Writer:

image

No, that cannot be the problem.

  1. I have loaded a Jpg (to see whether this is possible) and used the Image Writer to save it and it works like expected though it shows ‘Channel’ in the dimension mapping
  2. The last image processing node before writing the image is the ‘Merger’ where I explicitly give the dimension labels as X,Y,C… Also the Image Viewer is aware of the channels…
    So, that is not very likely to be an issue (if it would - how would I be able to fix that?)

Anyway, thank you for your answer! :slight_smile:

That’s exactly the issue. You should specify X,Y,Channel, not X,Y,C.

The Image Viewer doesn’t check the label of the dimension, it just provides an RGB renderer in all cases where the third dimension is <= 3.

Indeed, this solves the issue… thank you!
I had this issue also when not using the ‘Merger’. So basically, my 16-bit TIF-images are loaded with X,Y,C dimensions (I checked that) and I have to rename the third dimension if I want to get an RGB-image.
How could I have known that. Can you point me to some documentation which might be useful?

1 Like

Documentation is sparse indeed. I drew most of my knowledge from the example workflows on the server, from trial-and-error in all the config dialogs, and from following the issues on the knip repository over the last five years:


How do you read them? Which nodes etc.?

Yes, I used the ‘Image Reader’ node. But I have to admit, that these images already have been created before with an ‘Image Writer’ node (I read three different 16-bit gray scale images (TIF), cropped a region and saved it as a single TIF containing all three channels. Might well be that I should have done it differently. But as neither Fiji nor Python had problems with these TIFs, I assumed that things are set correct.)

Concerning the documentation: As I guess that I will not manage to follow things so continuously like you, I might come back asking here if there is any behaviour I do not understand :slightly_smiling_face:
But good to know that I did not miss any good documentation… (though I would be glad if there would be one available)

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.