Leave That Thing Alone Blog

Viewing By Entry / Main
1 Jul. 2007

I've added a ColdFusion 8 version of CFImageHistogram. This version takes advantage of the new cfimage capabilities, and JAI (Java Advanced Imaging) because that is now available in CF8.

The ColdFusion 8 version will return a struct containing the histogram statistics, it will also return an image of the histogram in cfimage format.

I've also done some speed comparisons between CF7 and CF8. Keep in mind these aren't scientific tests but they give you an idea of the speed increases using CF8 and JAI:

getColorHistogram() for a 300x450 pixel image
  CF7 CF7 with JAI CF8
time ms: 2518 56 165


getColorHistogram() for a 2048x3072 digital photo
  CF7 CF7 with JAI CF8
time ms: timeout 1484 943


getColorHistogramImage() for a 300x450 pixel image
  CF7 CF7 with JAI CF8
time ms: 2903 734 334


getColorHistogramImage() for a 2048x3072 digital photo
  CF7 CF7 with JAI CF8
time ms: timeout 2422 1040

Please note these tests were done with an older computer (Pentium4 2.4 Ghz, 1 GB RAM)

While 1040ms may seem like a long time to get the histogram of a 8megapixel digital photo, it is pretty impressive to think that 6,291,456 pixel's colors have been inspected in that time.

See the CFImageHistogram project page for more info, and since I get of lot of question about what image histograms can be used for see this.

Comments

There are no comments for this entry.