dinasset wrote:
As expected, the command -ge 50% cuts the image into two horizontal sections:
the bottom half remains totally black (all those pixels are below the limit of the threshold so none of them is affected by the next commands), the top half is converted into a sequence of many red lines; but they seem to be "drawn" at different horizontal distances among them, and there are also small segments.
Is there a ("simple") understanding of this result for poor users like me?
-sharpen, as used in -stained_glass, attempts to unblur what has become blurred.
Blurring is like squeezing toothpaste from a tube. Bit treacherous for four year olds, maybe, but they get the hang of it.
Unblurring is like getting the toothpaste back in the tube again.
-sharpen is faced with a task of reconstruction - make sharp again that which has been smeared by blurring. Now, there are all kinds of ways to blur an image. What is more, there are even some ways to unblur an image, but such ways usually depend on knowing what the original blurring method was and also knowing that this method was not destructive. Usually, though, when an image comes from out of the blue, and blurred, we have no idea what mechanism blurred it or whether it was destructive.
So we punt.
-sharpen is a tool with which we punt.
-sharpen embodies two unblurring technique. One is called shock filters, which we haven't been using, the other is called inverse diffusion, which we have.
Inverse diffusion is an interesting technique grounded on the analogy that a warm room with a hot rock used to be a cold room with a red hot rock - but that heat has diffused out, cooling the rock but warming the room.
-sharpen assumes that the sort of white areas in an image were once very white, the sort of dark areas were once very dark, and by implementing a process of inverse diffusion - pushing the hot back to the hot spots and the cold back to the cold - that maybe it can reconstruct the sharp transition edges that used to be betwixt the two.
Like I said, pushing toothpaste back into the tube.
-sharpen does a pretty good job, considering what it is given to go on, which usually isn't much. The amplitude we give -sharpen controls its diligence. Low amplitude means "Awww - just get the main edges and don't sweat the details." -sharpen won't sweat the details. High amplitude means "Don't come back here until you've found
ALL the edges, and - I - *DO* - mean - ALL of the edges!!!!" -sharpen will sweat the details.
Even those that aren't there.
OK. That's -sharpen. Plus a little bit on how to make it manic-depressive.
dinasset wrote:
surprise!
The lines are multicoloured, very nice but totally unexpected by me, and the part closer to the bottom
0.1% black zone has even a kind of coloured sand, like in a sand-glass.
Is there a simple understanding for me?
Now there's -distance, which also has to sometimes do two impossibilities before breakfast. -distance has to find the Euclidean distance of a pixel from the nearest reference pixel endowed with a particular intensity level - usually one or zero.
Seems straightforward. In fact, that's the first impossibility.
Euclidean distances are found with Pythagoreas' Formula: the beast which rubbed the ancient Greek noses into the smelly business of incommensurability. That there are numbers which cannot be represented as integral ratios sounded the death knell of arithmos - the echoes of which still sound in the English language today: rational. Nice sane ratios of integers. In terms of computer store, they take only what they need. How polite. Irrational - darn crazy numbers like the square root of two which cannot be precisely expressed unless one has an infinite store of memory handy. So, as often as not, -distance paints intensities which aren't quite right, because it has maybe sixty four, maybe one hundred twenty eight bits of storage, which can never be enough for the idiotic irrationals. That's the first impossibility. The second impossibility is that the distance, so figured or mis-figured, is for a point, dimensionless, infinity small, but a pixel has area and dimensions, so exactly to what does the distance refer? The middle of the pixel? One of the corners? No matter how you call it, the distance is going to be slightly not right for all but one point in the pixel, and it is probably not right for that either.
But -distance is a trooper. As best as it can, it paints a gradient of grays that (more or less) approximate how far pixels are from the benchmarks, suffused through the work, however, is an error pattern.
Now, along comes -sharpen (remember -sharpen?), to which Ronounours has handed an amplitude parameter of 1e10, for cat's sake, 10,000,000,000, alas, and not 27.128, and it's desperately insane about finding edges. Even ones that aren't there. -sharpen latches onto the diffuse error pattern that -distance has dribbled throughout the gradient and exclaims "Hell-on, these are edges or I'm not Harry!" and proceeds to sharpen them out as only a sharpener beset with an amplitude of 10,000,000,000 can. And that, dear dinasset, is what you are looking at - a faint error pattern left by -distance, which -sharpen has pulled from the murk.
And - as an aside - there is a certain sweetness to the thought that what is a bit of annoyance in the realm of computation can be a thing of beauty in artistic hands. So we don't have arithmos -- we never, ever, really had arithmos -- but there are compensations. Just need to know where to look for them.
Hope this helps.
Garry