Page 1 of 1

bmp to tiff batch conversion

Posted: 2016-05-04T17:08:20-07:00
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.

Re: bmp to tiff batch conversion

Posted: 2016-05-04T17:21:45-07:00
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

Re: bmp to tiff batch conversion

Posted: 2016-05-04T17:37:19-07:00
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

Re: bmp to tiff batch conversion

Posted: 2016-05-04T17:52:15-07:00
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.

Re: bmp to tiff batch conversion

Posted: 2016-05-04T17:57:30-07:00
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

Re: bmp to tiff batch conversion

Posted: 2016-05-05T03:41:11-07:00
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!

Re: bmp to tiff batch conversion

Posted: 2016-05-05T09:16:19-07:00
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.