in reply to Dealing with rectangular images

Would the diagonal diameter work?
#!/usr/bin/env perl use strict; # identify -format "%h:%w" image.png # 774:423 my $width = 423; my $height = 774; my $diag = sqrt( $width**2 + $height**2); print $diag, "\n";