Hello dinasett,
This is the heart of Colors->Abstraction, the sequence of six G'MIC
commands which operate on one image.
One obtains the implementation of Gimp-G'MIC filters by opening the
.updateXXXX.gmic file, obtained by pressing the refresh button on the
plugin, or, alternately, running the gmic -update command from a
shell. It may be reviewed in any text editing tool such as Notepad or
Wordpad.
-blur 1
-split c
-quantize 10,1,0
-area 0
-pow 0.2
-append c
I wrote about -area in detail in the last post. Consider a consequence
of that discussion. As a final step, -area assigns to each and every
pixel the size of the region it inhabits. If a pixel is in a large
region, it will obtain a large number and appear light. If it is in a
tiny region, it will obtain a small number and be dark. Broadly, then,
-area makes tiny areas dark and big areas light. That is the essential
step. The others perform important, but auxiliary chores.
For my contribution to this game, I've obtained an image of a rocky
outcrop near Pwll March, Newgale, Wales. It is from Wikimedia Commons
and the photographer is
Andy F.. I find its texture enchanting. We will walk through the abstraction
of this fine old rock.
-blur 1Since the key effect is area-based, blurring smears together pixels
that might otherwise group into very tiny regions. The "Smoothness"
parameter in the GUI directly sets -blur's argument. This is a key
simplification step before quantizing the image. Without some sort of
blurring, quantize will run riot and establish thousands of very tiny
regions. Larger values of blurring give rise to greater pixel smearing
and fewer regions.
-split cThis G'MIC command splits multichannel images into a series of single
channel grayscales, because that is the format that area requires. As
an aside, -split will segment an image along any cardinal axis; 'c'
chooses a 'channel' split, 'z' a split along depth, 'y' a split along
height and 'x' along width. An RGB image will leave three gray scales
on the image list.
-quantize 10,1,0Quantize forces pixels into a series of step values; the first
argument establishes the number of steps and corresponds to the
"Levels" parameter in the GUI. Here, it is the default value of ten
steps. The second and third arguments are boolean flags and are fixed
in the script. The second flag, keep_levels, requests that regions,
once quantized, be set close to the average gray of the
region. Otherwise it may drift. The third flag requests that however
many levels their are, these should be equally spaced values. That
will not obtain here as the flag is unset. The settings of these flags
are moot in the overall scheme of things, for the next command, -area,
will assign new gray levels to all pixels.
-area 0-area computes areas of connected regions; see the opening remark of
this post and the previous post. Here, it suffices to remark that tiny areas
such as rock cracks, will be dark, and vast areas, such as the sky will be
light. In my opinion, the surreal aspect comes from this reassignment of
intensity which is not especially governed by the original light source
in the image.
-pow 0.2 A consequence of the -area command assigning pixel count values that
scale with areas is an immense range of values. Pixels in large areas
will have values on the order of 100,000, others in single
digits. -pow compresses this dynamic range. It's argument maps to the
"Contrast" parameter. The higher that parameter, the greater is the
value given to -pow, compressing the dynamic range to a lesser extent.
-append c-append undoes -split, repacking the once-separated channels into a single
three channel, RGB image.
Omitted, cleanup. In particular, a renormalization of the image into
the range 0 - 255.
For my interpretation of this fine old rock, I took a different tack.
First, I blurred the rock using the Testing ->GmicTutor->Blur by color
filter, whose care and feeding is in a G'MIC Tutorial
Blur By Color.
where I followed the 6th Basic example (image based) to obtain
a kind of a waterfall effect of liquid flowing down the rockface.
That was then Abstracted, using the steps covered. Finally, I
cleared the sky, replacing it with a light, unsaturated grey-green,
and with a pristine copy of the original in a layer immediately
above, merged it with the abstracted layer, using the layer Color
compositing operator. This replaced the faux color scheme
of the Abstraction with the original, because I very much like
the original rocky color scheme.
Thank you for starting this thread; hope the technical details help.
Garry