[magick-users] Re: Trouble converting 300dpi jpeg to 72dpi jpeg with same size

Anthony Thyssen anthony at griffith.edu.au
Tue Nov 13 16:15:19 PST 2007


Nicolas Dhomont on  wrote...
| Thanks for your answer Michal.
| 
| I tried :
| 
| convert -units PixelsPerInch fromFile -density 72x72 toFile
| 
| But 'toFile' is still in 300dpi. 'toFile' file size is even more bigger=20
| than 'fromFile' file size. lol
| 
The only reason the filesize is bigger is that IM read the file from
some other source in and out again.

This in turn will change things as IM or more specifically the image
file format library IM uses, has its own ways of writing the image file.
Sometimes the filesize will be larger, sometimes smaller.  It depends a
a lot of internal decisions.

For example the JPEG quality setting is NOT the same from implementation
to implementation.  It is only a rough setting adjustment to the huge
number of controls that exist for the lossy JPEG image compression.

Speaking of JPEG.   *** Do not do this for JPEG!! ***

It will degrade the image just from the read and write as it is the
nature of the image file format.  A better method is to use a JPEG
specific, specialised program such as 'jhead' or a EXIF editor, to
modify the saved density setting in-situ.  That is eithout
reading-decoding-encoding-writing the image data itself.

Of course if you are modifying the actual image data, then of course set
the density, comments, EXIF settings etc, as part of that processing.

  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 -----------------------------------------------------------------------------
            The meek shall inherit the earth...
                       One meter wide, two meters long.
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/


More information about the Magick-users mailing list