There is a new KNIME forum. You can still browse and read content from our old forum but if you want to create new posts or join ongoing discussions, please visit our new KNIME forum:

How can get the size of an image as a variable?

Member for

3 years 10 months M42

The title says it: I want to know how large my image is, because I want to calculate things later on based on those measurements. How can I get the width and height of the image into a flow variable?

Thu, 01/25/2018 - 08:26

Member for

8 years 8 months


Hi M42,

you can use the image properties -> collection splitter -> row to variable.

Does that work?



Fri, 01/26/2018 - 09:43

Member for

3 years 10 months


Not quite. The Information is just output as a long string like

Image[name=myimage.png;source=;dimensions=2453,3462,3 (X,Y,Channel);min=38,20,0;pixel type=UnsignedByteType)]

Now, I could use some string manipulation to get the dimensions I guess, but isn't there a more elegant way?

If not, how would I do the string manipulation here?

Fri, 01/26/2018 - 12:45

Member for

6 years 10 months


Hi M42,

take a look at the attached example workflow that demonstrates Christian's answer.