make pwm output non linear

dhenry:
The way to do it in hardware fully is to output an analog voltage and run that voltage through a logrithmic V-I converter to drive an led.

A V-I converter can be an opamp; but the simplest would be to utilize a transistor's b-e junction non-linearity. Simple as that.

That would introduce a hardware derived nonlinearity, however, matching that to a gamma curve would be the challenging part and not as "simple as that". That is the difference between a neat idea and a functioning concept.

Also, gamma correct ion is similar but not entirely correct LED Brightness to your eye, Gamma correction – No! | HP LED Shield