Set(density,...)

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
tomred
Posts: 4
Joined: 2010-10-21T09:27:50-07:00
Authentication code: 8675308

Set(density,...)

Post by tomred »

Hi,

ImageMagick 6.6.5-8 Q16

I can't seem to set the density on a tiff image. Here's my code

Code: Select all

...
$image->Read($tif);
$image->Set(units=>'PixelsPerInch');
$image->Set(density=>'300x300');
$image->Set(density, '300x300');  # a little extra nudge
$image->Set(depth=>8);
$image->Resize(width=>$width, height=>$height);
$x = $image->Write(filename=> $new_name);
warn $x if $x
I have moved the order of the Set/Read items around but it hasn't made a difference. Here the output from identify:
  • Format: TIFF (Tagged Image File Format)
    Class: DirectClass
    Geometry: 2847x3069+0+0
    Resolution: 72x72
    Print size: 39.5417x42.625
    Units: PixelsPerInch
    Type: TrueColor
    Base type: TrueColor
    Endianess: MSB
    Colorspace: RGB
    Depth: 8-bit
    Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    Channel statistics:
    Red:
    min: 0 (0)
    .....
Does anyone know what might be wrong?
Thank in advance.
Dp
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Set(density,...)

Post by anthony »

Photoshop ignores the normal TIFF format density setting, but reads its own special profile image meta-data if present.
You will need to remove or modify that profile if you want photoshop to see the right density

See, IM Examples, Common File Formats, TIFF
http://www.imagemagick.org/Usage/formats/#tiff

NOTE I am not a Photoshop user, or even a PC user, so I only have the raw notes shown in the link above.
I would gladly accespt a HTML re-write of the above section by someone with more knowledge.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply