#!/usr/bin/perl use Gtk2 '-init'; my $posx=100; my $posy=100; my $pixbuf= Gtk2::Gdk::Pixbuf->new('rgb',0,8,1,1); $pixbuf->get_from_drawable(Gtk2::Gdk::Screen->get_default()->get_root_window(), undef, $posx, $posy, 0, 0, 1, 1); my ($r,$g,$b)=unpack('C*', $pixbuf->get_pixels()); print "($r,$g,$b)\n";