convert multiple tiff pages to png with respective pagenames

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

Moderators: XnTriq, helmut, xnview

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

convert multiple tiff pages to png with respective pagenames

Post by punith8626 »

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: 3976
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 »

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