Coppermine Mod: autoadjust “matte” color according to dominant image color

Someone in the Coppermine forums asked if Coppermine could auto-adjust background to image. My initial response was that it couldn’t do it with the core code, and I didn’t know if the image libraries that Coppermine used could do it.

After some research, I found that GD2 could do it, or at least help me do it. I thought it would be cool to implement in my own gallery so I decided to code it myself. The code is in the thread above. Check out my portfolio album with the feature. As you go through the images, the “matte” surrounding the image will change color to match the most dominant color in a random sampling of pixels in the image.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>