Click to See Complete Forum and Search --> : Dynamically Colouring Images


Geat
08-26-2003, 03:26 AM
I've got a really tricky problem and was hoping someone may have tackled something similar in the past.

We're creating a website template builder, in which there are several hundered colour schemes and (separate) templates available. Each template has a number of image schemes associated with it.

When the user selects a colour scheme, we're allowing a dynamic preview of the template with the images shown in the current colour scheme. Now, what we could do is have a different set of images stored for each colour scheme, but blatantly this is a last resort. What we want to is to dynamically colourise the images to reflect the schemes selected.

The PHP code is all in place - we just need to know how to use mogrify (or some similar tool or code) to gain the desired effect.

The image inherits the background colour of the element it is displayed in/on. As of yet we use the "-colorize" switch, which works well for some situations, but the majority yield somewhat neon images.

Can anyone out there help? (I appreciate it's a rather specific problem, and a bit of a long shot, but hey...) We basically need to know the best colouring for the "base" image, and what transformation(s) to perform on it.

Thanks for reading this far!