OK so here I have a problem I want solved, but I wouldn't know the beginning of how to correctly formulate it. So bear with me!
Sometimes when I postprocess b&w photographs in darktable, I change the tone curve in such a way that everything below (darker than) a certain level of gray gets "leveled out" to that level of grey. Losing the shadows, that is. (I do this by making a little horizontal "flat piece" in the bottom left corner of the tone curve square, where the left side touches the side of the square.) A prime example of this is the following photo, in which I erased all the shadows right under the bridge, creating that "flat" look that old photographs often have.
Only the problem is, sometimes when I do this, probably just because the tone curve square is not precise enough for me to get it just right, the deepest black pixels stay, as in this photo:
As I apparently am not able to solve this in darktable, I hoped there would be some imagemagick one-liner with which I could just "flatten out" these darkest pixels to the desired gray level. Say, something like:
convert in.jpg -flatten_up 10 out.jpg
..which would then take all r, g, and b values below 10
and change them to 10
, effectively replacing the black pixels by darkgrey.
Try converting "-level 10" to make 10 your black point, thereby losing everything below 10, then converting "-level +10" to move your black point back up to 10.