#!/usr/bin/perl use strict; use warnings; se FindBin qw/$Bin/; use Image::Magick; my $img = Image::Magick->new(); $img->Read($Bin.'/red.bmp'); my ($blob)=$img->ImageToBlob(magick=>'RGB', colorspace=>'RGB', depth=>'8'); my @data=unpack("C*",$blob); my $width=$img->Get('columns'); my $height=$img->Get('rows'); for(1..$height) { for(1..$width) { my ($r,$g,$b)=splice(@data,0,3); print "($r,$g,$b) "; } print "\n"; }