Changes in tif files properties after using mogrify.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
arutsuro
Posts: 2
Joined: 2014-10-06T20:55:58-07:00
Authentication code: 6789

Changes in tif files properties after using mogrify.

Post by arutsuro »

I am trying to use mogrify to insert a text in a tif file, but after the
command some of the attributes of the file changed, specially
the number of bits.
Before giving the command I have a tif file,with 2497 x 3582 pixels,
405 dpi and 8 bit depth.
I give first the following command:
mogrify -compress none -depth 8 -bordercolor white -border 70 p-0900.tif
And after that the attributes are still the same, and now having a 70 pixel white border in the image.
But after giving this other command:
mogrify -compress none -depth 8 -pointsize 50 -draw "text 100,60 'Page[0900]' " p-0900.tif
The Bit depth is now 32, and the size of the file is the double, the text is in its
place, but for a small text the size is now 19MB instead of 9.5MB.
What am I doing wrong.?
I am running ImageMagick-6.8.9-8-Q16-x64-dll in Windows 7, 64 bits.
Thank you.
Arutsuro.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Changes in tif files properties after using mogrify.

Post by snibgo »

From your numbers (2497 x 3582 pixels, 9.5MB) the input uses 1 byte per pixel. So it is either grayscale or palette. My guess is palette, and the draw operation increases the number of colours beyond 256.

A cure is to reduce the numbers of colours to 256. I forget the best way to do this, perhaps put "-colors 256 -type palette" before the output filename. But this will change some of the input colours.
snibgo's IM pages: im.snibgo.com
arutsuro
Posts: 2
Joined: 2014-10-06T20:55:58-07:00
Authentication code: 6789

Re: Changes in tif files properties after using mogrify.

Post by arutsuro »

Snibgo, you are right, the image is using only 8 bits, With your recommendation
I wrote -type Grayscale (Is an image of text), and now the output is still 8 bits,
and almost the same size than the original one.
Case close, and thank you for your help with my case.

Arutsuro
Post Reply