Cut A3 in half, save two A4?

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
dadaniel
Posts: 10
Joined: Tue Nov 22, 2011 12:14 pm

Cut A3 in half, save two A4?

Post by dadaniel »

Is it possible to cut a scanned A3 page in half and save it as two files in A4 size with XNView or NConvert?
cday
XnThusiast
Posts: 4395
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Cut A3 in half, save two A4?

Post by cday »

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...
cday
XnThusiast
Posts: 4395
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Cut A3 in half, save two A4?

Post by cday »

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.]
Last edited by cday on Sat Dec 08, 2012 4:21 pm, edited 3 times in total.
dadaniel
Posts: 10
Joined: Tue Nov 22, 2011 12:14 pm

Re: Cut A3 in half, save two A4?

Post by dadaniel »

Thank you very much for the example, will try it.

I think I will use -jpegcrop to do lossless cropping.
cday
XnThusiast
Posts: 4395
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Cut A3 in half, save two A4?

Post by cday »

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.
Post Reply