The Histogram module allows you to generate a histogram for images in nodes much like what you may be familiar looking at in Adobe Photoshop or in your camera.

The module creates a new field type and widget called "histogram". Once attached to a node, it will automatically create a histogram for the image field on the node when the node is saved. Currently, it only supports one image field per node per histogram field.

It can create stacked three color histograms as well as merged histograms. The background color can be set to any hexadecimal value or left blank for a transparent background. These options can be selected on an image by image basis or left at the default that is specified when the field is created.

In order to reduce unnecessary wait times on node save, the histogram will only be generated when the "Generate Histogram" radio button on the node edit form is set to "Yes". After making any changes to the image or the histogram settings, make sure you regenerate the histogram.

Features

  • Generates 3 channel stacked histograms or a merged histogram.
  • Auto detects black and white images and generates a single channel histogram.
  • Creates a small filesize png file for the histogram.
  • Only runs on node save so it saves resources.
  • Saves an array of the histogram values to the database for future planned upgrade involving a javascript graphing library generated histogram instead of a static image file.

Limitations and Future Plans

Right now the histogram will only work with node entity types. I want to change this in the future to work with all entity types.

Currently the module creates a png image of the histogram which is saved alongside the original image file. In future versions, I plan to replace this with a javascript graphing library that generates the histogram dynamically.

Project information

Releases