You can do better than that by taking advantage of character shapes, though.  Minimal example:<p><pre><code>    ()
</code></pre>
and:<p><pre><code>    )(
</code></pre>
have the same brightness values, but we see them pretty differently.<p>Ideally you would use edge detection, maybe some object detection, and then be willing to compromise a little on brightness in order to make important edges nice.  I don&#x27;t know if there&#x27;s software out there that does this, though.