I've solved my problem. By converting to gif and back, the semitransparent pixels are automatically either removed or "Anti-erased". Thus, this works perfectly:
I would like to remove pixels with less than ~20 opacity, and "Anti-erase" anything else. (I'm not quite sure of the technical name for it, but what I mean by "Anti-erase" is to make the pixel the same color with no transparency). I've already tried this: convert -alpha off input.png miff ...