Cut A3 in half, save two A4?
Moderators: helmut, XnTriq, xnview
Cut A3 in half, save two A4?
Is it possible to cut a scanned A3 page in half and save it as two files in A4 size with XNView or NConvert?
Re: Cut A3 in half, save two A4?
There is no function to split an image in a single operation, but an image can be split in XnView or NConvert by using two successive crop and save operations.
Note: This is the third request recently for a 'split' function...
Note: This is the third request recently for a 'split' function...
Re: Cut A3 in half, save two A4?
As splitting an image in XnView requires creating the crop areas manually it isn't suitable for processing many scans, but NConvert can automate the process.
The following Windows batch file splits 3000px x 2000px landscape jpg images in an 'Input' folder into equal left and right halves, suffixed -1 and -2 respectively, in an 'Output' folder. Save as 'split.bat' for example and create the 'Input' and 'Output' folders before running the file.
set w=3000
set h=2000
set /a x=%w%/2
nconvert -out jpeg -o C:\Z\Output\%%-1.jpg -crop 0 0 %x% %h% C:\Z\Input\*.jpg
nconvert -out jpeg -o C:\Z\Output\%%-2.jpg -crop %x% 0 %x% %h% C:\Z\Input\*.jpg
The script will batch process all jpg's in the 'Input' folder. Different pixel dimensions can be set by editing the w and h values, and the script could serve as a model for splitting a portrait image vertically into equal halves. The crop syntax is -crop x y w h and the origin is at the top left of the image.
When processing scans, the 'Auto deskew' function added to NConvert in v6.17 could be included in the script to straighten each image after splitting.
{Edited.]
The following Windows batch file splits 3000px x 2000px landscape jpg images in an 'Input' folder into equal left and right halves, suffixed -1 and -2 respectively, in an 'Output' folder. Save as 'split.bat' for example and create the 'Input' and 'Output' folders before running the file.
set w=3000
set h=2000
set /a x=%w%/2
nconvert -out jpeg -o C:\Z\Output\%%-1.jpg -crop 0 0 %x% %h% C:\Z\Input\*.jpg
nconvert -out jpeg -o C:\Z\Output\%%-2.jpg -crop %x% 0 %x% %h% C:\Z\Input\*.jpg
The script will batch process all jpg's in the 'Input' folder. Different pixel dimensions can be set by editing the w and h values, and the script could serve as a model for splitting a portrait image vertically into equal halves. The crop syntax is -crop x y w h and the origin is at the top left of the image.
When processing scans, the 'Auto deskew' function added to NConvert in v6.17 could be included in the script to straighten each image after splitting.
{Edited.]
Last edited by cday on Sat Dec 08, 2012 4:21 pm, edited 3 times in total.
Re: Cut A3 in half, save two A4?
Thank you very much for the example, will try it.
I think I will use -jpegcrop to do lossless cropping.
I think I will use -jpegcrop to do lossless cropping.
Re: Cut A3 in half, save two A4?
For lossless cropping using -jpegcrop see this post:
'Split image into two halves using crop command lossless JPG'
http://newsgroup.xnview.com/viewtopic.php?t=15273
cday.
'Split image into two halves using crop command lossless JPG'
http://newsgroup.xnview.com/viewtopic.php?t=15273
cday.