if i need a height of 23 cm (23x59px) =1357 px
Correct...
Code: Select all
nconvert -ratio -resize 0 1357 -dpi 150 tmp_bottle.png
Does that work? The help file states:
So the 0 1357 doesn't immediately look correct, but if it works...
And for add a canvas at top side i just have to write: -canvas (3cmx59px) ?
The help file states:
Code: Select all
-canvas w h pos : Resize canvas
w h can be percent (ex: -canvas 100% 200%)
or #x #y for offset
pos top-left, top-center, top-right
center-left, center, center-right
bottom-left, bottom-center, bottom-right
You need to calculate the new pixel height when you add 3cm to the existing height and use that pixel value with the existing pixel width, and also use 'bottom-center' so that the new canvas is added at the top, so something like:
...where wwww and hhhh are the actual pixel values you require.
Otherwise does it possible if i have a image folder in different path to create .bat in same folder?
The following option can be used to set the output path and file name:
Code: Select all
-o filename : Output filename
Use # to specify position of numeric enumerator
Use % to specify source filename
Use $ to specify full source pathname
Use $$ to specify source folder name
Note that % must be doubled to %% in a batch file.
The reality is that using the command line is demanding without previous experience, and very unforgiving of even small errors, so it is often necessary to be prepared to experiment to get the desired result and also to be patient. While I would like to help, there is a practical limit to the time that I can spend!!
If you have difficult progressing using NConvert I would suggest, as in my PM yesterday, that you consider using XnConvert where it should be easier to make progress. I am not sure how the processing time with XnConvert compares with that of that of a batch file using NConvert, but unless you have a very large number of files to process I don't think that it will be a consideration.