Subscribe to this thread
Home - General / All posts - Delete pixels of a certain value
jarrah19 post(s)
#27-May-22 05:55

The guides say that in Manifold 8 if was possible to select and then delete pixels of a certain value


Can that be done in M9?

I've tried the Select Expressions but to be honest they don't make any sense to me. There's nothing that relates to pixel values.

In my image there is a large block of value=2000 I'd like to delete, so I thought I could at least try deleting the tiles with constant values.

When I try


TileValueAvg([Fill]) = 2000;

the query results window lists a number of tiles, but no selection is added in the map window.


7,025 post(s)
#27-May-22 07:57

Working with rasters is done differently in 9. See the example topics for images, for example, like this one, but look at the query it creates using Edit Query button.

Also SELECT in SQL is not the same as interactive selection. See the comments in the beginning of the Selection topic. For examples of using selection functions in SQL, see this topic.

The way to do this in 9 is to use an UPDATE query, since you're updating stuff in a table, like in that first example topic above.


10,011 post(s)
#01-Jun-22 13:32

Use TileMaskRange.

Eg, to delete all pixels equal to 5 (make them invisible), use: TileMaskRange(tile, 5, 5, true, false)

The 5, 5 parameters define a range: from 5 to 5.

The next true parameter tells that the range should include its bounds: so the values inside the range are those from 5 to 5, inclusively, so just 5, and the values outside the range are everything else.

The last false parameter tells that the function should make values inside the range (5) invisible and keep values outside the range (anything other than 5) unchanged.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.