Resizing tiff smaller make image size grow a lot

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
fendale2000

Resizing tiff smaller make image size grow a lot

Post by fendale2000 »

I have a tiff file that is quite small, and I want to resize, however when I do so the image size grows. I think the resize command is changing the color depth of my image (its a black and white image). Here is the output of identity of the before and after versions of the image:


$ identify example.tif
example.tif TIFF 1654x2339 1654x2339+0+0 DirectClass 1-bit 6.1875kb 0.070u 0:02
$ identify example.tif
example.tif TIFF 828x1200 828x1200+36+36 DirectClass 16-bit 169.73kb

So it looks like my image has changed from 1bit, to 16 bit. How can I get it to stay at 1 bit as it is resized?

The command I used to resize it was:

mogrify -resize 1200x1200 example.tif

Thanks for the help!
fendale2000

Re: Resizing tiff smaller make image size grow a lot

Post by fendale2000 »

I have found the -depth switch that seems to get the image back to 1bit, but while I got it to work correctly once, everytime I try it on a selection of images now, it inverts the image (white to black and black to white), very strange. Here is my command:

$ mogrify -resize 750x -depth 1 example.tif
spieler
Posts: 47
Joined: 2004-10-08T09:03:16-07:00
Location: Iowa

Re: Resizing tiff smaller make image size grow a lot

Post by spieler »

Add "-monochrome -compress group4" to your command. When you resize the tiff, it does things in a "smart" way and probably produces some gray pixels or the like. Forcing it back to monochrome AFTER the resize should do it.
Post Reply