How to cut image of 5x5 from 1024x1086 image size

I need to cut the image of 5x5 size or 7x7 size from an image of 1024x1086 size. How can it be done in SNAP or how can it be done in other tools as well?
Anyone knows?

you can do this with gdal2tiles:

gdal is part of many open source tool, it comes with QGIS, for example so you just need to include the path to the gdal scripts to your system’s path to access it from any folder. Alternatively, you can use the config switch to name this directory in the call itself:

But, firsly I need to identify the region manually and then I need to cut the image. I don’t need to cut the image randomy of 5x5 size.
Can this be done with this, which you told.
For example: Please see the image below,
I want to extract and make 5x5 patch sized image of particular class.
Like, i want to make the patches of an image as shown in the rectangular boxes. I want to make the patches of those yellow rectangular boxes.

Please see the image attached below.

I showed some time ago how this can be done with a graph.

But as I know understood you want certain 5x5 windows and not split the whle image into 5x5 pieces.
For the manually selected regions you can set pins at the center and then use the pixel extraction tool (Raster / Export / Extract Pixel Values)
There you can specify a window and you can enable the export of sub-scenes with a specified border size.

The other option is to write a python script which usees GPF and configures the Subset operator.


Thanks, I will try it.

Thanks for the information you provided, they are very helpful to me