Replacing ImageMagick with NConvert

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

Moderators: XnTriq, helmut, xnview

Post Reply
darklyg
Posts: 4
Joined: Tue Sep 13, 2016 10:22 am

Replacing ImageMagick with NConvert

Post by darklyg »

Hi

I'm looking to replace ImageMagick for some automated image processing, and hoping that nConvert could be a good replacement. The performance on large files is much better, but I have a couple of questions which are causing me problems.

Can nConvert read Photoshop PSB files? I've tried a couple of samples, doing a -info displays sensible information, but doing any kind of processing or output gives "Error: Can't read file".

Are there any options that can be passed into a resize/thumb command? It looks like thumb and ratio resize fit the image inside the width/height. However we often use a "cover" option by passing "^" into ImageMagick which means that the image would be as small as possible but at least as big as the width/height given. Is this possible with nConvert without getting the width/height and doing a manual calculation?

Are there other options that can be passed into resize such as don't enlarge if the image is smaller than the dimensions?

thanks

Darklyg.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Replacing ImageMagick with nConvert

Post by xnview »

darklyg wrote: Can nConvert read Photoshop PSB files? I've tried a couple of samples, doing a -info displays sensible information, but doing any kind of processing or output gives "Error: Can't read file".
Yes, please send me a sample to try?
Are there any options that can be passed into a resize/thumb command? It looks like thumb and ratio resize fit the image inside the width/height. However we often use a "cover" option by passing "^" into ImageMagick which means that the image would be as small as possible but at least as big as the width/height given. Is this possible with nConvert without getting the width/height and doing a manual calculation?
You can use

Code: Select all

-resize longest size
Are there other options that can be passed into resize such as don't enlarge if the image is smaller than the dimensions?
yes

Code: Select all

-rflag decr
Pierre.
darklyg
Posts: 4
Joined: Tue Sep 13, 2016 10:22 am

Re: Replacing ImageMagick with nConvert

Post by darklyg »

xnview wrote: Yes, please send me a sample to try?
I can't send you the large psb due to client confidentiality, but it was just over 900Mb in size. Do you have a large psb you can test? I've also noticed that a smaller psb doesn't work correctly, although it was created from a B&W jpeg so not sure if that causes a problem.
xnview wrote: You can use

Code: Select all

-resize longest size
This is not quite what I need. I want to be able to specify both a width and height, but instead of the processed image fitting exactly inside the box, it covers the entire dimensions with any extra required. Does this make sense?
xnview wrote: yes

Code: Select all

-rflag decr
Thanks for this.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Replacing ImageMagick with nConvert

Post by xnview »

darklyg wrote: I can't send you the large psb due to client confidentiality, but it was just over 900Mb in size. Do you have a large psb you can test? I've also noticed that a smaller psb doesn't work correctly, although it was created from a B&W jpeg so not sure if that causes a problem.
the one that i have works
This is not quite what I need. I want to be able to specify both a width and height, but instead of the processed image fitting exactly inside the box, it covers the entire dimensions with any extra required. Does this make sense?

Code: Select all

-resize w h
Pierre.
darklyg
Posts: 4
Joined: Tue Sep 13, 2016 10:22 am

Re: Replacing ImageMagick with nConvert

Post by darklyg »

xnview wrote: the one that i have works
Ok, I am trying to get permission to share the original file which won't process at all, but I'm not confident. In the meantime I have uploaded a sample psb which won't process correctly. It doesn't give any errors, but the output file is just random colours.
https://www.wetransfer.com/downloads/cc ... 920/eb2761
xnview wrote:

Code: Select all

-resize w h
Sorry, thats not what I mean. Say I have a 400x200px image, and use nConvert with "-thumb 100 100" or "-ratio -resize 100 100" nConvert gives me 100x50px. But I would like an option to resize "cover" which would give me an output of 200x100px. So it keeps the same ratio, and is as small as possible to cover the supplied dimensions, but it doesn't matter if one dimension is larger to preserve the ratio. Does that make sense?
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Replacing ImageMagick with nConvert

Post by xnview »

darklyg wrote:
xnview wrote: the one that i have works
Ok, I am trying to get permission to share the original file which won't process at all, but I'm not confident. In the meantime I have uploaded a sample psb which won't process correctly. It doesn't give any errors, but the output file is just random colours.
https://www.wetransfer.com/downloads/cc ... 920/eb2761
ok i'll check. This file is loaded correctly by imagemagick?
xnview wrote:

Code: Select all

-resize w h
Sorry, thats not what I mean. Say I have a 400x200px image, and use nConvert with "-thumb 100 100" or "-ratio -resize 100 100" nConvert gives me 100x50px. But I would like an option to resize "cover" which would give me an output of 200x100px. So it keeps the same ratio, and is as small as possible to cover the supplied dimensions, but it doesn't matter if one dimension is larger to preserve the ratio. Does that make sense?[/quote]
So you can use

Code: Select all

-resize 100 0
Pierre.
darklyg
Posts: 4
Joined: Tue Sep 13, 2016 10:22 am

Re: Replacing ImageMagick with nConvert

Post by darklyg »

xnview wrote: ok i'll check. This file is loaded correctly by imagemagick?
Yes it saves into other formats without a problem.
So you can use

Code: Select all

-resize 100 0
This is fine with that image. But I want to define dimensions of 200x100, and it process a 800x400 image to 200x100, but also process a 400x800 image to 200x400 and a 400x400 image to 200x200. So whatever ratio image I upload, it produces an image at least 200x100 but preserving ratio. Take a look at the ^ resize operator on ImageMagick, which is described as "Minimum values of width and height given, aspect ratio preserved".

Thanks for your help so far, I realise that the "cover" option seems unusual at first, but its very useful in producing web thumbnails for fluid layouts.
User avatar
xnview
Author of XnView
Posts: 43326
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Replacing ImageMagick with nConvert

Post by xnview »

darklyg wrote: This is fine with that image. But I want to define dimensions of 200x100, and it process a 800x400 image to 200x100, but also process a 400x800 image to 200x400 and a 400x400 image to 200x200. So whatever ratio image I upload, it produces an image at least 200x100 but preserving ratio. Take a look at the ^ resize operator on ImageMagick, which is described as "Minimum values of width and height given, aspect ratio preserved".
Please send your email by PM, i would like to send you a test version
Pierre.
Post Reply