Create a custom Drupal Module (Drupal 6 and 7)
I have a content type that has products and attributes as cck fields
Inside this content type there are image fields which contain
what I am after is a module that will loop through all images
in a content type find the most dominant colour and then write
that colour as hex into a cck field that will be specified.
The module needs to evaluate the area of the image(s) and should have a 30% bounding box so that it is less likely to
choose background colours (see example attached)
A histogram will probably be the best way of finding the dominant colour.
The module has to be flexible enough to be used on other content types.
It has to have a dropdown where you specify what content type to use (This will be populated from the available
This will then have another dropdown where it will list all the image cck fields from the content type that were
previously selected. there is then a text field where you choose which image in the image field that it will use.
i.e. if you have 4 images in the image Field and you want the module to find the colour of the second image you would
write '2' in this field see example attached.
Finally there should be a dropdown where you can select which cck field you want the hex code (colour) written back to
(if the field already has text it should overwrite it)
The module needs to be able to be triggered/run on a cron job.
The module needs to be created for Drupal 6 and a version for Drupal 7,