bmp to tiff batch conversion

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
Misko78
Posts: 10
Joined: 2016-02-13T15:05:36-07:00
Authentication code: 1151

bmp to tiff batch conversion

Post by Misko78 »

How can i convert a .bmp image to a tif image with 300dpi resolution.

My bmp files, scans form a SP3000 scanner, are 72dpi images with size of 128x85cm, I would like to have them at 300dpi 30x20cm without changing resolution.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bmp to tiff batch conversion

Post by fmw42 »

What do you mean by without changing resolution? Do you mean you want the same number of pixels in WxH as before? If so, then just do

Code: Select all

convert inputimage -units pixelsperinch -density 300 outputimage
Misko78
Posts: 10
Joined: 2016-02-13T15:05:36-07:00
Authentication code: 1151

Re: bmp to tiff batch conversion

Post by Misko78 »

Exactly that same number of pixels in WxH as before!

But the problem is that, when i use code you suggested,

convert *.bmp -units pixelsperinch -density 300 test00.tif

it does only one file and from 3637x2433; 128,31x85,83cm; 72dpi i get 3637x2433; 12,12x8,11cm; 762dpi
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bmp to tiff batch conversion

Post by fmw42 »

What version of IM and what platform?

What are the original bmp file's density? Does it list 72 dpi or something else or nothing?

See

identify -verbose image.bmp

Can you post one of the offending bmp files that do not work the way you want? You can post to some free hosting service such as dropbox.com and put the URL here.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bmp to tiff batch conversion

Post by fmw42 »

You have said that your input is dpi (dots per inch), but you list page size in centimeter. So you need to factor in the units.

Do you want 300 dots per inch or 300 dots per centimeter? And is your input image 72 dots per inch or 72 dots per centimeter.

If everything is in cm, then use

Code: Select all

convert inputimage -units pixelspercentimeter -density 300 outputimage
Misko78
Posts: 10
Joined: 2016-02-13T15:05:36-07:00
Authentication code: 1151

Re: bmp to tiff batch conversion

Post by Misko78 »

Yeah i want them in dpi not per centimeter.

i finally got it

Code: Select all

mogrify -units pixelsperinch -density 300 -format tif *.bmp

Anyway, if only there is more people like you fmw42, always helping the people in need. :D A huge THANK YOU!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bmp to tiff batch conversion

Post by fmw42 »

If mogrify works, then so should convert. With mogrify, you will get one tif per bmp. With the convert command earlier you should get one multi-page tif, with pages for each bmp.
Post Reply