Solve blog

Ruff – Clustering image textures

Mark Grujic

Solve Geosolutions is releasing another free web app that aims to help geoscientists (and others!) get the most out of their data.

Ruff is an app that takes your images and returns the same image split into groups that have similar textural characteristics. To do this it uses the GLCM algorithm to find a bunch of numbers that describe the texture around each pixel in the image.

For most of the demonstration of the app in this post, we’ll use the following seismic reflection image from here.

Seismic reflection data from the Gabon South Basin

Let’s look at some of the textural components that are calculated using Ruff. Each parameter helps define things like roughness, slope, etc.

Some of the textural parameters that Ruff extracts from images

After we have our textures and applying some scaling, we can then group the pixels based on how similar their textural parameters are. In Ruff, this is done using k-means clustering, with the number of clusters determined by the user. Below, we see the result of using a 5 x 5 GLCM window and 6 clusters on the seismic reflection data.

The seismic reflection data with and without cluster colouring. A 5 x 5 GLCM window was used and 6 clusters were defined

It looks good! Nothing too out of place and you can see that adding colours to the image really does help distinguish areas with different textures.

What if we increased our window size? In the image below, the window size changes from 5 x 5 to 7 x 7, then 11 x 11. You will notice the clusters get coarser, as expected.

The GLCM window was changed to 7 x 7 then 11 x 11

Another example, this time using an airborne magnetics image. The same principle was applied, resulting in another layer of data to interpret.

The mag data (black/white), the clustered texture domains (colour), and the two overlapped

OK, last example, this time with SRTM elevation data from the Pilbara, Western Australia. Here, we’ve applied the same methodology and identified the clusters that appear to correlate well with interesting topographic features. We can isolate these clusters and see if they also occur in previously underappreciated areas.

SRTM elevation data over the Pilbara (greyscale) with selected textural clusters (colour)

In summary, Ruff provides the means to analyse the textural characteristics of images and provide you with an understanding of where similar textures appear in the image. Due to the computational requirements, Ruff will accept images less than 1MB in size. It’s not hard to imagine how this process can be applied to a wide range of other data applications!

We haven’t really discussed the nuts-and-bolts of the GLCM algorithm that Ruff uses, but it is generally considered to be a good first step at textural characterisation. Additionally, k-means clustering is also an OK first step, but results could be improved with more involved clustering routines.

Please try out Ruff by clicking here and let us know if you have feedback by contacting us at or

For more advanced analysis, Solve Geosolutions offers a host of more robust, neural-network based services that we would be happy to discuss with you!