Crop image
Posted: Fri Jul 05, 2019 4:29 pm
How to set the correct command in order to crop the image to the specified size. Do not squeeze
?
?
Various discussion boards for XnView and related products
https://newsgroup.xnview.com/
Zuldek wrote: Fri Jul 05, 2019 4:29 pm How to set the correct command in order to crop the image to the specified size. Do not squeeze
Code: Select all
-crop x y w h : Crop
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
Code: Select all
nconvert -ratio -resize shortest 180 -overwrite %title_alt%.jpg
nconvert -ratio -canvas 50 100 -overwrite %title_alt%.jpg
Zuldek wrote: Sat Jul 06, 2019 3:49 pmDoes not go, the image size remains the sameCode: Select all
nconvert -ratio -resize shortest 180 -overwrite %title_alt%.jpg nconvert -ratio -canvas 50 100 -overwrite %title_alt%.jpg
Reduce the width of the image, equally about the center??Zuldek wrote: Sat Jul 06, 2019 4:46 pm Reduce the canvas, that is, size the image. Parts of the image that do not fit the size, they are cut off.
Zuldek wrote: Sat Jul 06, 2019 5:12 pm A width of 200 is required, a height of 100. If possible, yes, in the center.
Code: Select all
nconvert -canvas 200 100 center dff.jpg
Code: Select all
nconvert -canvas 200 100 center -o Output.jpg -out jpeg -q 70 Input.jpg
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
Code: Select all
-resize longest size : Scale longest side
-resize shortest size : Scale shortest side
Code: Select all
nconvert -ratio -resize shortest 180 -o titlee.jpg -q 70 scrinshot.jpg
nconvert -canvas 320 180 center -o titlee.jpg -q 70 titlee.jpg
You seem to have made some progress, but it is sometimes difficult to understand what you wish to do...Zuldek wrote: Sun Jul 07, 2019 10:51 amThe first stage is image compression.Code: Select all
nconvert -ratio -resize shortest 180 -o titlee.jpg -q 70 scrinshot.jpg nconvert -canvas 320 180 center -o titlee.jpg -q 70 titlee.jpg
The second stage is cropping the image.
You wish the output from the second stage to have the name 'titlee.jpg' and it doesn't? I suspect the problem arises from the fact that when a file of the same name already exists in the same folder, the output file is given a suffix -1, -2 etc.I don’t quite understand how to save the image with the same output name in the second stage. So that no titlee_1.jpg titlee_2.jpg
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
Use $EXIF:DateModified[date format] to specify EXIF date modified
Use $EXIF:DateTaken[date format] to specify EXIF date taken
Date format: Please check documentation of strftime