Page 1 of 1
I'd like to create a slit-photography script
Posted: 2010-10-03T16:47:39-07:00
by luigi
Hi All,
I need some help from the IM community.
I have a list of JPG files extrated from a video.
I'd like to get a 1 pixel slice from the middle of each file and then create an image putting every slice one after the other.
So if I have 2000 images of 1024x768 the result is a 2000x768 image as there would be 2000 slices 1 pixel wide.
I guess it can be done with convert -crop and montage but I'm not in a bright day and I don't know how.
Thanks a lot if you can help me!
Luis
Re: I'd like to create a slit-photography script
Posted: 2010-10-03T17:17:29-07:00
by luigi
I think I had a lapse of brightness :
for %%Y in (%1) do convert.exe -crop 1x1080+960+0 %%Y "slit_%%Y"
montage -tile x1 -geometry +0+0 slit*.jpg result.jpg
del slit*.jpg
Hope you find this useful
(first convert the video file to invividual JPGs then run this batch as foo.bat frames*.jpg)
Please verify if I did this right or if I mangled something!
Re: I'd like to create a slit-photography script
Posted: 2010-10-03T17:24:30-07:00
by fmw42
see -chop which allows you to extract a row row or column from the middle of an image
http://www.imagemagick.org/Usage/crop/#chop
The problem may be your OS's ability to list so many images at one time when you go to put all the slices together using montange.
You may be better off writing a script loop to chop the data from each image and then append it successively to some temp images so that you build up the final image one slice at a time.
see append
http://www.imagemagick.org/Usage/layers/#append
you may have to start with one column of constant data as the temp file and then chop from each image, append to the temp and then at the end, crop or chop off the first non-relevant row or column that was used as the initial temp file. Alternately, put an conditional in the loop to take the first slice of column or row and use as the initial temp without appending. Then for all other rows or columns use that temp file and chop a new slice from another image and append to the previous temp.