Fix slow posterize filter
Create the non-linear gamma transforms beforehand.
Patch by Carl Olsson, thanks!
Differential Revision: https://phabricator.kde.org/D21529