Improving nConvert performance

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

Moderators: helmut, XnTriq, xnview

Post Reply
Arvind
Posts: 12
Joined: Wed Apr 21, 2010 9:11 am

Improving nConvert performance

Post by Arvind »

Hi,
I am using nconvert to transform a given file to another file of different dimensions.
Input File size: 541 kb
Command used: "C:\XnView\nconvert" -out jpeg -truecolors -bgcolor 255 255 255 -ratio -resize 0 0 -canvas 0 0 center -o "E:\mxImage\Color_Way_A.jpg" "E:\Color_Way_A.jpg"
This is taking about 400 millsec to complete.

My program has to do several such conversions one after the other. So, it ends up taking a lot of time.

I would like to know ways to improve time taken by nconvert. Are there any settings or extra parameters i can use which will cut down the time taken without affecting the quality of the output file to great extent?
Will batch conversion help? If yes, how should it be used?
Any other ideas are welcome.

Regards
arvind
User avatar
xnview
Author of XnView
Posts: 46238
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Improving nConvert performance

Post by xnview »

-resize 0 0 -canvas 0 0 ???
Pierre.
Arvind
Posts: 12
Joined: Wed Apr 21, 2010 9:11 am

Re: Improving nConvert performance

Post by Arvind »

Sorry.
That was a wrong example.

Cosnider this:
"C:\XnView\nconvert" -out jpeg -truecolors -bgcolor 255 255 255 -ratio -resize 42 42 -canvas 42 42 center -o "E:\mxThumbnail Image\B_W_Sketch_Front_B_W.jpg" "E:\B_W_Sketch_Front_B_W.jpg"

Also, is there any documentation to explain what each of these options to nconvert command are meant for? I could not find any useful write up on these options.
User avatar
xnview
Author of XnView
Posts: 46238
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Improving nConvert performance

Post by xnview »

Arvind wrote:"C:\XnView\nconvert" -out jpeg -truecolors -bgcolor 255 255 255 -ratio -resize 42 42 -canvas 42 42 center -o "E:\mxThumbnail Image\B_W_Sketch_Front_B_W.jpg" "E:\B_W_Sketch_Front_B_W.jpg"
Is it possible to have the file?
Also, is there any documentation to explain what each of these options to nconvert command are meant for? I could not find any useful write up on these options.
nconvert -help
Pierre.
Arvind
Posts: 12
Joined: Wed Apr 21, 2010 9:11 am

Re: Improving nConvert performance

Post by Arvind »

Files differ in every use case i use. But stiil, I can share few sample files. Please let me know how should I send them. I could not find Upload Attachment option anywhere. Can i send by email directly to you? If yes, please give the mail id.

nconvert -help : this just gives the possible command line options and brief info.
Is there a complete description of what each option can do?
User avatar
xnview
Author of XnView
Posts: 46238
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Improving nConvert performance

Post by xnview »

Arvind wrote:Files differ in every use case i use. But stiil, I can share few sample files. Please let me know how should I send them. I could not find Upload Attachment option anywhere. Can i send by email directly to you? If yes, please give the mail id.
contact at xnview dot com
nconvert -help : this just gives the possible command line options and brief info.
Is there a complete description of what each option can do?
No, perhaps it will be a good idea to enhance nconvert documentation on http://wiki.xnview.com
Pierre.
User avatar
foxyshadis
Posts: 395
Joined: Sat Nov 18, 2006 8:57 am

Re: Improving nConvert performance

Post by foxyshadis »

If you timed it, I bet most of your time would be wasted in the actual startup and shutdown of nconvert, not the internal manipulation. It's a pretty bulky program. You'd probably be better off hooking into gfl sdk as a dll/so so it only has to load up once, or using batch conversion to process the whole list in one session. It's very simple to set up batch conversion:

"C:\XnView\nconvert" -truecolors -bgcolor 255 255 255 -ratio -resize 42 42 -canvas 42 42 center -out jpeg -o "E:\mxImage\%.jpg" -xall "E:\*.jpg"

If you need different size thumbnails, though, it could be tougher.
Arvind
Posts: 12
Joined: Wed Apr 21, 2010 9:11 am

Re: Improving nConvert performance

Post by Arvind »

I tried batch conversion using below command from command-line. It failed.
The files to be converted do not have any pattern in their names; they colud be random file names. SO, i need a generic way of reading all of them & applying nconvert on each one.

Code: Select all

"C:/XnView/nconvert" -out jpeg -truecolors  -bgcolor 255 255 255 -ratio -resize 80 80 -canvas 80 80 center  -o "F:/test/target/%%.jpg" -xall "F:/test/*.jpg"
** NCONVERT v5.31 (c) 1991-2009 Pierre-E Gougelet (May 13 2009/10:57:10) **
        Version for Windows NT/9x/2000/Xp/Vista  (All rights reserved)
** This is a freeware software (for non commercial use)

  Error: Can't open file (F:/test/*.jpg)

Conversion of F:/test/*.jpg into F:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4Q.jpg OK
Arvind
Posts: 12
Joined: Wed Apr 21, 2010 9:11 am

Re: Improving nConvert performance

Post by Arvind »

I tried by removing double quotes in the filepath.
It could read all files in the input directory but only one generated file is created. The target file name is not having the same name as input file. IT is being generated as %%.jpg

Code: Select all

   "C:/XnView/nconvert" -out jpeg -truecolors  -bgcolor 255 255 255 -ratio -resize 80 80 -canvas 80 80 center  -o F:/test/target/%%.jpg -xall F:/test/*.jpg
When run on the command prompt:

C:\Documents and Settings\qfp>"C:/XnView/nconvert" -out jpeg -truecolors -bgcolor 255 255 255 -ratio -resize 80 80 -canvas 80 80 center -o F:/test/target/%%.jpg -xall F:/test/*.jpg
** NCONVERT v5.31 (c) 1991-2009 Pierre-E Gougelet (May 13 2009/10:57:10) **
Version for Windows NT/9x/2000/Xp/Vista (All rights reserved)
** This is a freeware software (for non commercial use)

Conversion of F:/test/Color_Way_B.jpg into F:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4Q.jpg OK
Conversion of F:/test/F-15_MiG-27.jpg into F:/test/target/F:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4QF:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4Q.jpg OK
Conversion of F:/test/ForecastEarth.jpg into F:/test/target/F:/test/target/F:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4QF:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4QF:/test/target/F:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4QF:/test/target/└ûæ|    ║ûæ|⌠4Q└ûæ|    ║ûæ|⌠4Q.jpg OK
Post Reply