Uploading a purely grayscale image causes the image to be darkened when displayed by discourse. This applies to images in posts, as well as images uploaded as avatars. for example, take this image:
This is much darker that the image is supposed to be. However, if I shift the R,G, or B value of a single pixel, it will display correctly. In this case, I have shifted the top left pixel from (172,172,172) to (173,172,172). This is the only change I have made between the source images.
Now, because of the R value being shifted in one pixel, the image is being displayed accurately.
Unfortunately, this fix is not reliable for avatars. Once the image is scaled down, the shifted pixel gets lost and the smaller image gets darkened again. As a result, you can end up with a grab bag of light and dark avatars. To make it work for avatars, you pretty much need to shift a region of pixels, instead of just a single pixel.
Here’s an example of a user who tried uploading a grayscale avatar with a single altered pixel. Note the version in the usercard is lighter than the resized version next to the post:
Here is an example of an avatar that works successfully. The entire background on this image was shifted slightly using the technique described in the OP.