ImageMagick looks awesome and very versatile.
Two things at the moment I'm wondering if and how ImageMagick could do:
1) Convert tif, rgba16 to rgba8. There's also something about orientation involved, as flipping occurs when down-sampling with photoshop.
2) World Machine has a snow function which fills concave areas, and spills over, much as you'd expect snow to do. But it adds overflow and mounds. I'm wondering if ImageMagick could do something similar, but simplified, as if with water levels, finding brightest rings of pixels encompassing darker areas, and filling them with like brightness.
Convert tif, rgba16 to rgba8; Filling concaves of heightmap
-
- Posts: 4
- Joined: 2014-03-01T02:53:02-07:00
- Authentication code: 6789
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
2) Some examples might explain the concept.
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2014-03-01T02:53:02-07:00
- Authentication code: 6789
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
Terrain without snow effect:

With snow:

Heightmap, before:

After:

It's snow device does snow well, but I can't get it to fill all concave areas without a bunch of overflow (it's a moderate amount in the example). I think some nice plateaus might be achieved if these concave areas could be filled to the 'brim' - the 'brim' being the brightest encircling ring of pixels, defining a region of darker pixels.
I think such a function would make lots of flat, traversable areas, at varying levels, for a somewhat noisy heightmap like that.

With snow:

Heightmap, before:

After:

It's snow device does snow well, but I can't get it to fill all concave areas without a bunch of overflow (it's a moderate amount in the example). I think some nice plateaus might be achieved if these concave areas could be filled to the 'brim' - the 'brim' being the brightest encircling ring of pixels, defining a region of darker pixels.
I think such a function would make lots of flat, traversable areas, at varying levels, for a somewhat noisy heightmap like that.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
Hmm, interesting problem. It really depends on the exact rules. Suppose we have a shallow basin next to a deeper basin, so there is a ridge between them. Some water (or snow) falls, so both basins have the same depth of water in them. More rain so the water levels rise until the shallow basin becomes full, level with the ridge. What happens them? Perhaps water spills over, instantly filling the deep basin. Or maybe the next rain makes no difference to the shallow basin because it is already full, so the level in only the deep basin rises.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
Imagemagick does not have a "watershed" function. It is one of the feature that did not get implemented in the -morphology function.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
A watershed function is:
Code: Select all
%IM%convert ^
%INFILE% ^
( +clone ^
-statistic NonPeak 3x3 ^
) ^
-compose MinusSrc -composite ^
-fill white +opaque black ^
%OUTFILE%
snibgo's IM pages: im.snibgo.com
-
- Posts: 4
- Joined: 2014-03-01T02:53:02-07:00
- Authentication code: 6789
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
"It is one of the feature that did not get implemented in the -morphology function"
Does that mean there's some un-implemented code lying around somewhere?
I've overlayed the result as black.

That's interesting. It traced the convex edges, one pixel in width. Is that what it's supposed to do? I don't see any fill happening, and, it's a binary map.
I suppose it would be a good supply of starting points in finding areas to fill.
Does that mean there's some un-implemented code lying around somewhere?

I've overlayed the result as black.

That's interesting. It traced the convex edges, one pixel in width. Is that what it's supposed to do? I don't see any fill happening, and, it's a binary map.
I suppose it would be a good supply of starting points in finding areas to fill.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
No, not that I know about. It just never got implemented. I suspect Anthony either did not know about that function or just never got around to it, when he build the -morphology command."It is one of the feature that did not get implemented in the -morphology function"
Does that mean there's some un-implemented code lying around somewhere?
-
- Posts: 4
- Joined: 2014-03-01T02:53:02-07:00
- Authentication code: 6789
Re: Convert tif, rgba16 to rgba8; Filling concaves of height
This watershed thing is an interesting subject. I've found it lead into image scanning of grains of rice.