#!/usr/bin/perl use strict; use warnings; use FindBin qw/$Bin/; use GD; my $img = GD::Image->new($Bin . '/a.bmp'); my $index=$img->getPixel(10,10) my ($r,$g,$b) = $img->rgb($index);