# Adjust Resolution if necessary $image->SetAttribute('units'=>'PixelsPerInch'); my ($xrez,$yrez) = $image->GetAttribute('x-resolution', 'y-resolution'); if ($xrez > 72 || $yrez > 72) { $image->SetAttribute('density'=>'72x72'); }