Welcome to our community

Be a part of something great, join today!

  • Hey all, just changed over the backend after 15 years I figured time to give it a bit of an update, its probably gonna be a bit weird for most of you and i am sure there is a few bugs to work out but it should kinda work the same as before... hopefully :)

Free Downsampling Tool for 4k->SD etc Progressive Images

conrad gaunt

Banned
Joined
May 31, 2007
Messages
946
Reaction score
0
Points
0
IT HAS A HOMEPAGE NOW:

http://helloconradgaunt.googlepages.com/home

I`ve decided to write a freeware windows utility (which will run under linux using "WINE" or using a MAC equivilent) for batch downsampling folders of images from 4k-> SD etc , as the subject came up on the forum, and I`ve never had a problem downsampling 4k DSLR timelapse sequences directly to SD using this method.
I believe its does an excellent job on progressive (I may support interlaced later) images, and will be able to downsample to any resolution in a day or two. Its all floating point processing, and I have plans for it to grow. Its very ugly looking after only 1 long night development, but works enough for testing. I`d really appreciate knowing if its useful or not.
Lots of image formats are supported, although 16bit processing is limited to some types of uncompressed 16bit TIFF. info and some future plans for the utility are included in the program (press info button).
If you`d like to try it, please send me your email and I`ll post it (400k zip). Thankyou, ronx :construction:
 
  • Thread starter
  • Banned
  • #3
Thanks for sharing Ronx.
I will give i a try in Sunday, since is one of the things that needs to be improved with Red One.
I hope you make in the aplication the possibility to change the final resolution in diferent formats and as well abailable for European Pal system.
Jon Corcuera
DIT

Your welcome. I`ll make the resize adjustable tonight or tomorrow. The tool is only intended for downsampling progressive sources really, I may add interlacing stuff later, though I`ll never personally create interlaced footage again. I`m planning on adding a detail preserving adaptive de-interlacer in the future. I`ll probably add 8bit AVI input options soon too, but not export or QT. Let me know what resolutions and interlacing options you think are needed, when you have time, and I`ll see what I can do. thankyou

EDIT: Output size is now adjustable.
 
1- I think what you're doing is very useful... as some programs don't do scaling that great.

2- In the long run, it might be that Red will do something similar. Because Epic = 5K... presumably there will be a high quality downconversion from 5K->4K.

On the other hand, I think there's a need for good desktop format conversion (sacrifice speed in favour of quality, and low cost relative to $$$$$ hardware boxes)... and Red's tools may not fill that gap (e.g. if it only works with Red footage, then it won't handle all situations).
For example, the scaling in Vegas is not that great. You can hack it (http://www.dvinfo.net/conf/showthread.php?t=117523) but that's not a very fast solution.
 
  • Thread starter
  • Banned
  • #5
1- I think what you're doing is very useful... as some programs don't do scaling that great.

2- In the long run, it might be that Red will do something similar. Because Epic = 5K... presumably there will be a high quality downconversion from 5K->4K.

On the other hand, I think there's a need for good desktop format conversion (sacrifice speed in favour of quality, and low cost relative to $$$$$ hardware boxes)... and Red's tools may not fill that gap (e.g. if it only works with Red footage, then it won't handle all situations).
For example, the scaling in Vegas is not that great. You can hack it (http://www.dvinfo.net/conf/showthread.php?t=117523) but that's not a very fast solution.

I`m glad you think it might be useful. It won`t be for everyone. I definately require High quality resampling and I`m not leaving it to chance as I can program. I have many resampling methods, this one takes you straight from 4k -> SD, no messing about.
I`m hoping people won`t say, too sharp, too soft, just "why doesn`t all software do that!". If not, I`ll try another method till I get it right.
I`ll also be adding many advanced filtering options to the tool, and utilities such as foreground/background seperation, for static camera shots, so foreground can be filtered seperately from backgorund, think green screen without the green screen, or black & white actors in a colour world,all shot in situ. without a green screen). What I`m struggling with is relatively simple things like decoding 16bit TIFFs properly. Anyway, my 16bit TIFF hack seems to work! :) (NB, I can do an 8bit decode from most file types, including compressed 16bit TIFFs)
As for speed, I don`t do real-time, and I don`t trust applications that sell themselves with it. I just want reliable quality. If I`m in a rush I split jobs across a couple of Windows/linux laptops. Generally I organise myself so I`m not in a rush. The resampling method I use is quite fast (although the software is .386/windows3.1 compatible, and could be much faster with a different compiler), and all floating point. I intend to get a Mac Book Pro too for basic editing when needed. Thanks for the thoughts

EDIT: I just tried the link, do people really downsample that way?!
 
  • Thread starter
  • Banned
  • #6
ps, You can select the output resolution yourself now, and the preview is capable of displaying/schrolling output images bigger than 720x576. Also added a little progress bar and cleaned code up a bit. Tomorrow you`ll be able to select a destination folder other than the default source folder and rename the output how you want (instead of just appending the original filename). The first filters will start arriving in the tool in the next couple of days, all floating point RGB processing accuracy of course (what other kind is there? real-time? lol!)
 
EDIT: I just tried the link, do people really downsample that way?!
I don't think so (and it's far from obvious). But if you didn't do a hack like that, then you are stuck with Vegas' scaling algorithms and they seem to have excessive aliasing.

all floating point RGB processing accuracy of course (what other kind is there?
Well there's different levels of floating point accuracy... 32bit, 64bit, 64/80-bit... and you can set the Visual Studio compiler to do fast, strict, or precise. 32-bit fast is probably the best idea as it's an overkill of precision for film/video use.
And if you really want to get into it, floating point math can get pretty wacky. If you're not careful 3 / 10.0 * 10.0 can equal 2. But I think I'm being pedantic here...
 
I`m hoping people won`t say, too sharp, too soft, just "why doesn`t all software do that!". If not, I`ll try another method till I get it right.
I think to some degree, one resizing algorithm might be best for one type of image while another resizing algorithm would be better for another type of image.

2- Some approaches I'd look at would be:

A- Resampling color differently than luminance. When resizing color, it's best to have zero ringing / no negative lobes or response. Low aliasing is second most imortant. So there are potentially very subtle gains from resizing color differently than luminance.
There are some pictures here (figure 11):
http://glennchan.info/articles/technical/chroma/chroma1.htm

B- Linear light processing for scaling I'm on the fence about.
http://www.glennchan.info/articles/technical/resampling/linearLight.htm

C- An adaptive method that handles edges differently than non-edges would probably be very nice (but I've not tried this).

On non-edges, resampling with something resembling the sinc function would be nice. But it gives objectionable halos on edges, so you want to do something there to handle edges differently.

D- You'd have to decide how many lobes of the sinc function you want... the extra lobes might be a bad thing because you have the extra ringing/"echoes" that look out of place.

E- Contrast enhancement, e.g. unsharp mask, might possibly be useful because it gives the illusion of sharpness. And contrast makes a much bigger impact on our perception of sharpness than actual resolving power (e.g. ability to read letters on an eye chart; sharpness tricks don't really help that).

One issue with unsharp masking is halos... so perhaps an even better algorithm would be edge adaptive and try to minimize them. (I've not tried this.)


Perhaps a good approach would be to implement a multitap FIR filter that gets rid of aliasing and has a small amount of ringing/halos (this will be somewhat blurry)... and then let the user dial in some small amount of unsharp mask. It wouldn't take much development time and would probably get you 80% of the way to the "best" algorithm.
 
I don't think so (and it's far from obvious). But if you didn't do a hack like that, then you are stuck with Vegas' scaling algorithms and they seem to have excessive aliasing.

Yes, or alternatively, don`t downsample in vegas, use a program designed to do an accurate job.


Well there's different levels of floating point accuracy... 32bit, 64bit, 64/80-bit... and you can set the Visual Studio compiler to do fast, strict, or precise. 32-bit fast is probably the best idea as it's an overkill of precision for film/video use.

My software can use all types, but 32bit is fine.

And if you really want to get into it, floating point math can get pretty wacky. If you're not careful 3 / 10.0 * 10.0 can equal 2. But I think I'm being pedantic here...

Never had a problem. Whacky things can happen with integers too, if you`re not careful 1 / 2 can equal zero, and then, when you multiply the result by 4.7, it still equals zero :) I don`t want to get into it, I am in it.

I`ve posted updates everyday for three days, it would be great if you could give some feedback on the resample quality, which you can do by downloading the tool from it HOMEPAGE and using it for free

Just started adding AVI support.

HOMEPAGE:

http://helloconradgaunt.googlepages.com/home
 
I think to some degree, one resizing algorithm might be best for one type of image while another resizing algorithm would be better for another type of image.

2- Some approaches I'd look at would be:

A- Resampling color differently than luminance. When resizing color, it's best to have zero ringing / no negative lobes or response. Low aliasing is second most imortant. So there are potentially very subtle gains from resizing color differently than luminance.
There are some pictures here (figure 11):
http://glennchan.info/articles/technical/chroma/chroma1.htm

B- Linear light processing for scaling I'm on the fence about.
http://www.glennchan.info/articles/technical/resampling/linearLight.htm

C- An adaptive method that handles edges differently than non-edges would probably be very nice (but I've not tried this).

On non-edges, resampling with something resembling the sinc function would be nice. But it gives objectionable halos on edges, so you want to do something there to handle edges differently.

D- You'd have to decide how many lobes of the sinc function you want... the extra lobes might be a bad thing because you have the extra ringing/"echoes" that look out of place.

E- Contrast enhancement, e.g. unsharp mask, might possibly be useful because it gives the illusion of sharpness. And contrast makes a much bigger impact on our perception of sharpness than actual resolving power (e.g. ability to read letters on an eye chart; sharpness tricks don't really help that).

One issue with unsharp masking is halos... so perhaps an even better algorithm would be edge adaptive and try to minimize them. (I've not tried this.)


Perhaps a good approach would be to implement a multitap FIR filter that gets rid of aliasing and has a small amount of ringing/halos (this will be somewhat blurry)... and then let the user dial in some small amount of unsharp mask. It wouldn't take much development time and would probably get you 80% of the way to the "best" algorithm.

I hear what you`re saying. I`d like the software to make the right choice automtically (but let me override its decision if I wish), and you`re right, there are many resampling methods. I`m trying to create one that I can trust for the job. I trust this method right now. I`ll be trying several other methods, especially for upsampling. One method is to convert the image into a sequence of wavelet coefficients first..
I could create a more "subjective" resampler that uses edge detection methods and the like (which is great I think for PS CS or still photography and images), but I don`t want to introduce temporal jittering in moving sequences, which may be a byproduct. Then again, demosaicing makes similar "subjective" decisions, so I will investigate further.

As it stands, the resampler has a few automatic internal functions to maintain RGB B&C. Please feel free to use it, it is usable :)

http://helloconradgaunt.googlepages.com/home
 
Back
Top