PDA

View Full Version : JPEG crop/resize/add borders questions


csaag
7th December 2004, 22:23
Goal is to take a series of pictures from a digital camera and make a NTSC DVD slideshow to play on a fullframe TV.

According to an article here:
http://www.uwasa.fi/~f76998/video/conversion/

I should take my original pictures, crop them to a 4:3 ratio, resize them to 704x480, then add 8 pixels of black border to each side to make it 720x480.

So I'm trying to find a way to do all that.

Cropping is easy enough, although time consuming but I don't want to crop each picture at the same place so I think I'm stuck here cropping each photo seperately. I downloaded Irfanview which makes batch resampling to any size easy (Under advanced options, check resize & enter the desired size and also check the resample box)

So now I have a bunch of 704x480 JPG files. Now how do I make them 720x480 with 8 pixels of black borders on each size? Any way to do it with an automatic process rather than edit each picture individually? Can AviSynth be used to open a series of photos and resize/add borders and save the photos in JPG? I know it has addborder & several resize functions, but I'm quite a newbie with AviSynth and not sure how accomplish that even if thois can be done with Avisynth.

Wilbert
7th December 2004, 22:54
Yup, that's possible.

Just renumber the jpgs (when necessary) and load them with ImageSource (or ImageReader):

ImageSource(...)
AddBorders(0,8,0,8)
ImageWriter(start = 0, type = "jpeg")


http://www.avisynth.org/ImageSource
http://www.avisynth.org/ImageWriter

btw, dvd can also be 704x480, so there's no need to change them.

csaag
8th December 2004, 04:04
I was able to load the following into VdubMod:

ImageSource("d:\TEMP\name%d.jpg")
AddBorders(0,8,0,8)
ImageWriter(start=0, type="jpg")

This loaded all of the jpg's into Vdub.
But what do you do to activate it?
I chose 'file->Save Image Sequence' but that menu only gives you
a choice of png/tga/bmp

When I used the scroll bar to go thru all the input jpg images, it 1st gave an error message that said 'Image Reader: Images must have identical widths' (these jpg's are all of different resolutions) then a message that said 'Image Reader Can not open DevIl library reading file xxxxx" for numbered pictures that extended past what I had for input (i.e I had 25 files, that message started with filename26.jpg). I just want to save the files to a different directory (or to the same directory with a different name - i.e no overwriting of the original file)

EDIT: I used Irfanview to resize all the pictures to the same size, that gets rid of the 'identical widths message'.

2nd question: As far as resizing goes, Can I use AviSynth if the pics aren't all the same res? If so, then there are several resizing functions - any recs on one to use? The camera gives me pictures that are sized around 2000 x 1500 pixels at maximum. Even with cropping I'd still be reducing them (to 704x480). I have no idea what function would give me the best output to reduce a jpg file.

thanks.