I'm trying to generalize a raster to get clean edges (see sample and "optimal" result below). However the borders bleed into each other to a rather high degree. I hacked away at the raster using majority filter, boundary clean and shrink, but it seems like I'm mostly shifting the noise around. What would be a good way to achieve a clean separation? The value range of the raster is 426-548, with 75 unique values. White = nodata.