You might be interested to read it to learn a bit about how to do pixel manipulation in SDL C api.
It still needs tests. I left the issue open with a 'low hanging fruit' and a 'help wanted' tag. Also, the issue is nicely filled out with a description of the problem, and even a test case (not in unittest format).
So the issue is ready if anyone wants to
https://www.pygame.org/wiki/ContributeThere's a few of them prepared like this under the 'help wanted' tags.
I've written a doc on how to write a unit test(with python stdlib), and how to write one for pygame. I'm waiting for a friend to review it first before adding it to the "Contribute" page.