Is it possible to automatically extract tiles from comics, with an existing tool like ImageMagick or should I code a tool myself?
I have seen answers using ImageMagick (Using imagemagick how can i slice up an image into several separate images?, https://superuser.com/questions/1308928/how-to-automatically-crop-and-cut-an-image-into-several-images-using-imagemagick/1308953#1308953) but in my case the tiles can be of different size (the height can change).
There is always 1 tile below each other (only 1 column) and each tile is separated by some space of the same color (a horizontal color gradient with black, grey or white could be used in the image for spacing tiles) so it should be possible to detect when there are new tiles and extract them, by looking at horizontal lines with the same pixels color.
Ideally, it should also be possible to extract tiles if the comics has 2 or more columns with tiles from different height (which could be a bit more complicated since there will not necessarily be full horizontal lines with the same pixels color).
Update: You can find a quick sample I made below, as requested. Some comics have some characters and text bubbles going out of the tile which make it not possible to compare pixels on a horizontal line, so I added this on purpose on the sample. I also added another column and tiles with a different width or height in order to have a sample with a summary of what can be found in comics.