Hello,
I want create border with different color.
I use 2 canvas with 2 bgcolor.
But the border is only white.
Can I use multiple bgcolor?
The command line :
-out jpeg -opthuff -q 80 -i -rmeta -rexifthumb -ratio -rtype lanczos -rflag decr -resize 1600 0 -bgcolor 0 0 0 -canvas #20 #20 center -bgcolor 255 255 255 -canvas #30 #30 center
Multiple bgcolor
Moderators: XnTriq, helmut, xnview
-
- Posts: 10
- Joined: Sun Mar 22, 2020 2:11 pm
Re: Multiple bgcolor
Double canvas resize doesn`t work.
Does anyone know how to make border (with two colors) in the nconvert?
Does anyone know how to make border (with two colors) in the nconvert?
-
- XnThusiast
- Posts: 4183
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
-
- Posts: 10
- Joined: Sun Mar 22, 2020 2:11 pm
Re: Multiple bgcolor
i need to make border (1 px black line + 7 px white line for each side) for resized image.
i try to use this code:
"C:\XnView\nconvert.exe" -quiet -out jpeg -ratio -rflag decr -resize longest 1328 -rtype lanczos -bgcolor 0 0 0 -canvas #2 #2 center -bgcolor 255 255 255 -canvas #14 #14 center -overwrite -q 92 -opthuff -dct 3 -smoothingf 0 -subsampling 0 "%%~fA*"
but this code make one color border (resize canvas #16 #16 with bgcolor 255 255 255).
i try to use this code:
"C:\XnView\nconvert.exe" -quiet -out jpeg -ratio -rflag decr -resize longest 1328 -rtype lanczos -bgcolor 0 0 0 -canvas #2 #2 center -bgcolor 255 255 255 -canvas #14 #14 center -overwrite -q 92 -opthuff -dct 3 -smoothingf 0 -subsampling 0 "%%~fA*"
but this code make one color border (resize canvas #16 #16 with bgcolor 255 255 255).
-
- XnThusiast
- Posts: 4183
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Multiple bgcolor
Have you exported that code from XnConvert, or XnView MP Batch Convert, it looks as if you may have, and if so did you get the desired result in that software?
-
- Posts: 10
- Joined: Sun Mar 22, 2020 2:11 pm
Re: Multiple bgcolor
In XnView batch converter double canvas resize works properly.
Export to bat contains with code:
nconvert -npcd 2 -size 256x256+0 -ctype rgb -corder inter -out jpeg -bgcolor 0 0 0 -canvas 101%% 101%% center -bgcolor 255 255 255 -canvas 102%% 102%% center
But this code doesn`t work properly in NConvert (it makes one canvas resize with bgcolor 255 255 255).
Export to bat contains with code:
nconvert -npcd 2 -size 256x256+0 -ctype rgb -corder inter -out jpeg -bgcolor 0 0 0 -canvas 101%% 101%% center -bgcolor 255 255 255 -canvas 102%% 102%% center
But this code doesn`t work properly in NConvert (it makes one canvas resize with bgcolor 255 255 255).
-
- XnThusiast
- Posts: 4183
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Multiple bgcolor
Thanks, that was a preliminary question mainly out of curiosity...
I am a volunteer with limited experience at the command line, and try to provide some support because no-one else does except Pierre who has very limited time. In addition there is limited documentation of some aspects of NConvert.
I am not sure whether canvas resize can be used twice in the same code line in NConvert but your result seems to suggest that it can't, unless there is a different problem with your code.
My immediate suggestion therefore is to test using two successive resizes in separate code lines in a batch file .bat.
I am a volunteer with limited experience at the command line, and try to provide some support because no-one else does except Pierre who has very limited time. In addition there is limited documentation of some aspects of NConvert.
I am not sure whether canvas resize can be used twice in the same code line in NConvert but your result seems to suggest that it can't, unless there is a different problem with your code.
My immediate suggestion therefore is to test using two successive resizes in separate code lines in a batch file .bat.
-
- Posts: 10
- Joined: Sun Mar 22, 2020 2:11 pm
Re: Multiple bgcolor
Thanks.
This method is working.
But it significantly increases the processing time. And most likely double conversion in jpeg reduces image quality.
This method is working.
But it significantly increases the processing time. And most likely double conversion in jpeg reduces image quality.
-
- XnThusiast
- Posts: 4183
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Multiple bgcolor
Good
In principle it could, but Is the image quality actually noticeably reduced the way you use the created images, even if necessary when you use the optimum quality settings?But it significantly increases the processing time. And most likely double conversion in jpeg reduces image quality.
I'm not sure if NConvert can use multiple cores, I don't see an option in the 7.32 help file, possibly not added yet...
-
- Posts: 6
- Joined: Sat Aug 15, 2020 3:01 am
Re: Multiple bgcolor
This post is little old but I permit me to give an important hint.
To avoid this quality loss by an double conversion to jpeg, use an intermediate lossless format like png that will do an exact copy of your original image where you will do all your work losslessly, and then only at the end step convert it to jpeg.
To avoid this quality loss by an double conversion to jpeg, use an intermediate lossless format like png that will do an exact copy of your original image where you will do all your work losslessly, and then only at the end step convert it to jpeg.