Page 1 of 1

Set(density,...)

Posted: 2011-01-26T06:11:56-07:00
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

Re: Set(density,...)

Posted: 2011-05-16T21:12:09-07:00
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.