tile creation for multiple images

Hello,
I have created the following workflow but have a couple of issues.
cropper

First issue is, its cropping only the first image, there are 10+ JPG images in the folder, set in ‘list files’. How can I make it continue cropping through “list files” ?

Second is, I want to create a folder containing same name (same fn) for each image, and create crops of that image, into same named folder. Is this possible?
Thanks!

Hi @rogerwilco,
you need to add a loop end node, it stops after the first image because the first loop iteration never ends. You can just use the Variable Loop End node connected to the Image Writer.

Selection_076

best,
Gabriel

2 Likes

Hi,
Thank you for the reply, if fact, after a night of struggle, I have managed to create something better.

In new version, It seems it will eventually read files from a folder, and crop them individually, into a “tiles” folder. The problem is, after writing first set of tiles, it moves to second image, but, filename remains same (custom filename selected in image.writer) and workflow stops, due to “overwrite” condition.

I cannot find a way to use main image’s name as prefix plus a counter, for the tiles created (like, for IMG058.JPG: IMG058-001.tif, IMG058-002.tif, etc…)

Then, (more preferred alternative) I decided to create a folder (using filename of main image, for foldername) for the tiles of of each individual image, this way, when I choose custom filename in image writer, (image_) there wont be any problems, but failed on directory creation also.
I am attaching the workflow.
Please help! :slight_smile:

KNIME_projcrop4.knwf (20.2 KB)

I have managed to do the second option above (folders as image names, and image_xxx as filenames within folders), allthough not sure if this is the most optimized way of doing it, also I am getting several warnings etc…

Here is the workflow, would you like to take a look?

KNIME_projcrop6.knwf (26.4 KB)