use Tk; $mw = Tk::MainWindow->new; $can = $mw->Canvas(-width => 320, -height => 240)->pack(); $img = $mw->Photo(-width => 320, -height => 240, -palette => '256/256/256'); $img->blank; $can->createImage(0, 0, -image => $img, -anchor => 'nw'); $img->put(RED, -to => (160, 120)); printf "%6.6X", $img->get(160, 120); MainLoop();