convert multiple tiff pages to png with respective pagenames

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, xnview

Post Reply
punith8626
Posts: 41
Joined: Thu Feb 02, 2017 11:22 am

convert multiple tiff pages to png with respective pagenames

Post by punith8626 » Wed Oct 25, 2017 9:50 am

Hi

I have a requirement to convert multiple tiff files to png in one shot with ordered pagenumber.
This is how I am trying.

Code: Select all

nconvert -out png -resize 87 112 -xall  -o C:\\png\###.png C:\\tiff\*
After first file the 2nd tiff file pages again starts with 001.png.

I need something like this
I have 3 tiff files having 3 pages in each
t1.tiff
t2.tiff
t3.tiff
I need result something like this
001.png
002.png
003.png
004.png
005.png
006.png
007.png
008.png
009.png

but current result will give always 3 results and it overwrites.

cday
XnThusiast
Posts: 1782
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: convert multiple tiff pages to png with respective pagenames

Post by cday » Wed Oct 25, 2017 6:55 pm

You can avoid having the output PNGs from each TIFF overwritten by including the source filename option '%' in your code, for example:

Code: Select all

-o %###.png
If you are unable to create a number sequence you can work with directly, you would then need to renumber the output PNGs created using a second line of code in a batch file. Replace '%' by '%%' in a .bat batch file.

NConvert has the following renumbering option:

Code: Select all

-n start end step : Begin End Step (for image sequence)
If you can't use that rather limited option, you should be able to use the command line renumbering utility Bulk Rename Command.

Post Reply