blubb444
22nd December 2012, 20:43
What I want to do is take very many static images (or frames from a video) and average them into one single image (denoising), I've been looking for months for a program/tool that can easily do it but yet haven't found anything that works well. All I found were some very cumbersome workarounds, like for example loading them all up in GIMP as layers and set their opacity to 100%/[number of images] (has to be done manually for them all :/) or stack Avisynth's Merge function several times (in that case the number has to be 2^n if I'm not mistaken and it takes too much time to write as well plus you'd probably get rounding errors)
I'm thinking of doing the following:
- Separate the incoming image into planes (Y, U, V or R, G, B)
- For each plane, create a 2D integer array (32bit should do, 16bit would limit the number of incoming images to 256) the size of the plane which simply adds up the pixel values of each incoming image
- Merge the three planes somehow to get a "raw 32bit" YUV/RGB... image and optionally save that to the hard disk for further editing
- Take the raw 32 bit image and convert it into an 8 bit array by dividing all the values by number of pictures and then rounding (or optionally dithering), then into suitable format of choice (PNG/BMP... (has to be converted to RGB beforehand of course, or is there a lossless image format that supports YUV?)), and export that to hard disk
Doesn't sound like a very complicated thing to do, but unfortunately I'm not deep enough into the "Avisynth language" to know how to create such array variables or even how to access single pixel values of a video, so could someone help out here?
(Oh and of course RAM could become a problem with very large files, for example a 20MP image without chroma subsampling would hit the 2GB so maybe I'd have to work with intermediate files)
I'm thinking of doing the following:
- Separate the incoming image into planes (Y, U, V or R, G, B)
- For each plane, create a 2D integer array (32bit should do, 16bit would limit the number of incoming images to 256) the size of the plane which simply adds up the pixel values of each incoming image
- Merge the three planes somehow to get a "raw 32bit" YUV/RGB... image and optionally save that to the hard disk for further editing
- Take the raw 32 bit image and convert it into an 8 bit array by dividing all the values by number of pictures and then rounding (or optionally dithering), then into suitable format of choice (PNG/BMP... (has to be converted to RGB beforehand of course, or is there a lossless image format that supports YUV?)), and export that to hard disk
Doesn't sound like a very complicated thing to do, but unfortunately I'm not deep enough into the "Avisynth language" to know how to create such array variables or even how to access single pixel values of a video, so could someone help out here?
(Oh and of course RAM could become a problem with very large files, for example a 20MP image without chroma subsampling would hit the 2GB so maybe I'd have to work with intermediate files)