Convert .bmp to .tif with specific resolution

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
ucmlamb

Convert .bmp to .tif with specific resolution

Post by ucmlamb »

I am trying to convert a .bmp image to a tif image with 300x300 resolution. Convert is making a conversion but the resolution of the created .tif file is not specified so subsequent operations on the .tif file are failing. Any ideas or suggestions on how to make this work?

Thanks
Mike

Platform: Win32
Results of Convert using -Verbose:
>convert -verbose Mike161755.bmp -verbose Mike161755.tif
Mike161755.bmp BMP 208x112+0+0 PseudoClass 2c 8-bit 3198b 0.0u 0:01
Mike161755.bmp BMP 208x112+0+0 PseudoClass 2c 8-bit 3198b 0.0u 0:01
TIFF Directory at offset 0x0
Image Width: 208 Image Length: 112
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Software: "ImageMagick 5.4.9 09/01/02 Q16 http://www.imagemagick.org"
Document Name: "Mike161755.tif"
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 112
Planar Configuration: single image plane
Mike161755.bmp=>Mike161755.tif TIF 208x112+0+0 PseudoClass 2c 8-bit 0.0u 0:01
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert .bmp to .tif with specific resolution

Post by fmw42 »

what is your exact command and can you provide a link to your bmp file so others can check if it has any problems or try the conversion?

did you include -density 300?
ucmlamb

Re: Convert .bmp to .tif with specific resolution

Post by ucmlamb »

After making this post I continued my research and found -density (as fmw42 noted) (I must have missed it on my first pass of the Convert documentation). Anyway I got it working as I wanted it to work using the following:

convert Myfile.bmp -density 300x300 -units pixelsperinch Myfile.tif

This is the verbose output.
Mike095943.bmp BMP 608x192+0+0 PseudoClass 2c 8-bit 14654b 0.0u 0:01
Mike095943.bmp BMP 608x192+0+0 PseudoClass 2c 8-bit 14654b 0.0u 0:01
TIFF Directory at offset 0x0
Image Width: 608 Image Length: 192
Resolution: 300, 300 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Software: "ImageMagick 5.4.9 09/01/02 Q16 http://www.imagemagick.org"
Document Name: "C:\Firestone\3.07\Source\image\Mike095943.tif"
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 192
Planar Configuration: single image plane
Mike095943.bmp=>Mike095943.tif TIF 608x192+0+0 PseudoClass 2c 8-bit 0.0u 0:01

Thanks for your help
Mike
fkjt79
Posts: 7
Joined: 2012-04-11T07:58:39-07:00
Authentication code: 8675308

Re: Convert .bmp to .tif with specific resolution

Post by fkjt79 »

ucmlamb wrote:[...]
Anyway I got it working as I wanted it to work using the following:

convert Myfile.bmp -density 300x300 -units pixelsperinch Myfile.tif
[...]
+1 this helped me too

(should it not be the default?)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert .bmp to .tif with specific resolution

Post by fmw42 »

I think the default is the units in your input image.
fkjt79
Posts: 7
Joined: 2012-04-11T07:58:39-07:00
Authentication code: 8675308

Re: Convert .bmp to .tif with specific resolution

Post by fkjt79 »

fmw42 wrote:I think the default is the units in your input image.
ok, that makes sense, too.
Post Reply