The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Color::Similarity::HCL - compute color similarity using the HCL color space

SYNOPSIS

  use Color::Similarity::HCL qw(distance rgb2hcl distance_hcl);
  # the greater the distance, more different the colors
  my $distance = distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );

DESCRIPTION

Computes color similarity using the color space and distance metric defined in the research report:

HCL: a new Color Space for a more Effective Content-based Image Retrieval

M. Sarifuddin <m.sarifuddin@uqo.ca> - Rokia Missaoui <rokia.missaoui@uqo.ca> Département d'informatique et d'ingénierie, Université du Québec en Outaouais C.P. 1250, Succ. B Gatineau Quéebec Canada, J8X 3X7

http://w3.uqo.ca/missaoui/Publications/TRColorSpace.zip

FUNCTIONS

distance

  my $distance = distance( [ $r1, $g1, $b1 ], [ $r2, $g2, $b2 ] );

Converts the colors to the HCL space and computes their distance.

rgb2hcl

  [ $h, $c, $l ] = rgb2hcl( $r, $g, $b );

Converts between RGB and HCL color spaces.

distance_hcl

  my $distance = distance_hcl( [ $h1, $c1, $l1 ], [ $h2, $c2, $l2 ] );

Computes the distance between two colors in the HCL color space.

SEE ALSO

http://w3.uqo.ca/missaoui/Publications/TRColorSpace.zip

Corrected the RGB -> HCL transformation (see rgb2hcl) as per the research report by the same authors (thanks to David Hoerl for finding the document with the corrected formula).

Color::Similarity, Color::Similarity::RGB, Color::Similarity::Lab

AUTHOR

Mattia Barbon, <mbarbon@cpan.org>

COPYRIGHT

Copyright (C) 2007, Mattia Barbon

This program is free software; you can redistribute it or modify it under the same terms as Perl itself.