Help with CANVAS and RESIZE
Moderators: XnTriq, helmut, xnview
Help with CANVAS and RESIZE
Hello.
I want to process a pack of images with different scales - need to crop and resize to 4:3 scale.
For example, on screenshot: red rectangles - source images, green - desired results.
Initialy I used this command:
nconvert -ratio -resize 0 2000 -canvas 1500 2000 center -i -o dest.jpg source.jpg
It was good for one type of images, but for second - it leaves black lines on a sides of image.
Is there solution to use one line command to deal with both types of scales?
May be canvas longest, resize longest
Have no ideas...
I want to process a pack of images with different scales - need to crop and resize to 4:3 scale.
For example, on screenshot: red rectangles - source images, green - desired results.
Initialy I used this command:
nconvert -ratio -resize 0 2000 -canvas 1500 2000 center -i -o dest.jpg source.jpg
It was good for one type of images, but for second - it leaves black lines on a sides of image.
Is there solution to use one line command to deal with both types of scales?
May be canvas longest, resize longest
Have no ideas...
Re: Help with CANVAS and RESIZE
When resizing an image to a particular ratio requires new canvas to be added, the colour of the canvas added is set by the -background option:
When no colour is specified the default value may well be black.
I'm not sure looking quickly whether that is your problem, but you might take a look at that...
Code: Select all
-bgcolor red green blue: Background color (for rotate/canvas)
-bgcolor2 red green blue alpha: Background color (for rotate/canvas)
I'm not sure looking quickly whether that is your problem, but you might take a look at that...
Re: Help with CANVAS and RESIZE
Hello,
The -bgcolor and -bgcolor2 doesn't work when i use -keepcspace option. My original picture have a 32bit color depth.
For example :
nconvert -q 85 -ratio -rtype lanczos -rflag orient -keepcspace -resize longest 1000 -bgcolor 255 255 255 -canvas 1000 1000 center -out jpeg -o "C:\TEMP\photo1.JPG" "C:\MEDIATHEQUE\photo.EPS"
The added background get a random color.
Any ideas?
Thanks
The -bgcolor and -bgcolor2 doesn't work when i use -keepcspace option. My original picture have a 32bit color depth.
For example :
nconvert -q 85 -ratio -rtype lanczos -rflag orient -keepcspace -resize longest 1000 -bgcolor 255 255 255 -canvas 1000 1000 center -out jpeg -o "C:\TEMP\photo1.JPG" "C:\MEDIATHEQUE\photo.EPS"
The added background get a random color.
Any ideas?
Thanks
Re: Help with CANVAS and RESIZE
You want to keep 32-bit depth, or output a 24-bit image with a selected background color? In the latter case, you could test including a term to set the bit depth to 24-bit.
Re: Help with CANVAS and RESIZE
You might look at this recent thread for ideas if you haven't already done so.
I don't have much experience with 32-bit, but when I had a quick look at the poster's problem using XnConvert, I also obtained an output file with a green background.
Otherwise you will have to wait for Pierre the developer of NConvert.
Re: Help with CANVAS and RESIZE
and if you use
why do you want -bgcolor?
Code: Select all
nconvert -q 85 -ratio -rtype lanczos -rflag orient -resize longest 1000 -bgcolor 255 255 255 -canvas 1000 1000 center -out jpeg -o "C:\TEMP\photo1.JPG" "C:\MEDIATHEQUE\photo.EPS"
Pierre.
Re: Help with CANVAS and RESIZE
With -keepcspace option i got black (or random color) stripesxnview wrote: ↑Thu May 19, 2022 11:07 am and if you usewhy do you want -bgcolor?Code: Select all
nconvert -q 85 -ratio -rtype lanczos -rflag orient -resize longest 1000 -bgcolor 255 255 255 -canvas 1000 1000 center -out jpeg -o "C:\TEMP\photo1.JPG" "C:\MEDIATHEQUE\photo.EPS"
Re: Help with CANVAS and RESIZE
ok, the original image is in CMYK, you would like to keep it in CMYK?
Pierre.
-
- Posts: 2
- Joined: Tue Oct 17, 2023 9:56 pm
Re: Help with CANVAS and RESIZE
j'ai le même problème,
nconvert -ratio -rtype lanczos -rflag orient -resize 600 600 -canvas 600 600 center -bgcolor 255 255 255 "C:/PHOTOS/AL23512-PD01.jpg"
le fond est noir
nconvert -ratio -rtype lanczos -rflag orient -resize 600 600 -canvas 600 600 center -bgcolor 255 255 255 "C:/PHOTOS/AL23512-PD01.jpg"
le fond est noir
Re: Help with CANVAS and RESIZE
il me faudrait votre imageRENEDANSET wrote: ↑Tue Oct 17, 2023 10:06 pm j'ai le même problème,
nconvert -ratio -rtype lanczos -rflag orient -resize 600 600 -canvas 600 600 center -bgcolor 255 255 255 "C:/PHOTOS/AL23512-PD01.jpg"
le fond est noir
Pierre.