Intervention/image — pull request #220 by jwpage (2014-08-31 00:09:19+00:00)
Title: Rewrite Gd\Color::alpha2gd for improved performance

This changes the Gd\Color::alpha2gd implementation from one based on iterating through arrays, to one that's more maths-based.

I've uploaded a simple benchmark that runs through 1000 conversion operations with each method, and then also runs through 10,000 conversion operations to ensure the the outputs of both methods match. http://3v4l.org/4sqOa

This really falls under the category of micro-optimisation, but I was using Intervention\Image to set each pixel of a 500x500 image, so it ended up being a pretty big performance gain in the end. (Though for the record, I ended up using gd functions directly)