my $v=$magick->Get('width')/$magick->Get('height'); if($v > 1) { # breiter als hoch } elsif($v < 1) { # höher als breit } else { # quadratisch }