Continued probs with hi-quality downsampling of hi-res photos
Feb 9, 2007 at 5:43am
Continued probs with hi-quality downsampling of hi-res photos
As you may know, I’ve been trying for a year to find a way of doing high-quality downsampling of hi-res photos using Jitter. The goal is being able to downsample a source photo of up to 4k x 4k (or cropped subset thereof) with high-quality interpolation in Jitter. The most manageable solution seemed to be using jit.lcd. Alas, even the simplest attempt at putting this into an iterative process bombs after about 1.5 hours. Please see the attached simplified file (just iterating a load of jit.matrix that then feeds jit.lcd) with notes included. Any help is greatly appreciated!
——related approaches to the same problem——–
Joshua mentioned a while back about the possibility of exposing high-quality interpolation right in the jit.matrix. Any chance of progress on this? ;)
There have been several other solutions offered:
1. averaging downsample: doesn’t provide high-enough quality
2. JS Image class using fromnmedmatrix() and tonamedmatrix(): this worked on Max 4.5.x but broke on 4.6. Joshua apparently spent a bunch of time trying to work this out in 4.6 but never resolved.
3. “make clever use of jit.convolve to perform arbitrary filters”: no clue how to approach this :(
4. use external app like ImageMagick to do the heavy lifting: I’ve implemented this on a Mac PPC using mxj.syscommand (unsupported) but that object doesn’t appear to run on Intel Mac. Anybody know another way of communicating with Mac system on Intel?
5. prescale the images in Photoshop: doesn’t fulfill the project design spec… must be on the fly.
6. Use Java libraries: unfortunately over my head
7. new dimscale feature of jit.gl.slab and jit.gl.imageunit: can’t get to work
Any help or suggestions? I’m getting desperate!
Feb 9, 2007 at 5:53am
On Feb 8, 2007, at 9:43 PM, Jeff Burger wrote:
> 7. new dimscale feature of jit.gl.slab and jit.gl.imageunit: can’t
Check out example I posted in this thread. Make it downsample instead
Feb 9, 2007 at 7:40pm
Thanks, Joshua. Unfortunately, this solution doesn’t appear to work with anything close to hi-res source images… not even 1080 HD. Here’s what I get when I set the dims on the jit.qt.movie to 1920 x 1080:
>error: jit.gl.pbuffer: error binding invalid pbuffer!
(This is on a Mac G5 2.5GHz dual with 2.5GB RAM and stock Radeon 9600 XT.)
Since I’m only importing hi-res still photos, I tried modifying your routine by replacing jit.qt.movie with jit.matrix and clocking the matrix. (Using jit.matrix also gives the benefit of reading in a photo of unknown dims, where jit.qt.movie appears to need to know the exact dims in advance in order to get best quality?) The jit.matrix approach seems to work fine with source photos up through 1080 HD. A test with 2400 x 1568 source photo yielded distorion, though. And a test at 3000 x 2008 gives me:
>jit.gl.texture: error submitting texture data: GL error: invalid value
Again, while my original attempts included accepting images up to about 6000 x 4000, I’ve scaled this expectation back about as far as I can to the 4096 x 4096 max that I perceive the OpenGL routines work with.
BTW, I realized after I sent the original message that the attachment wasn’t zipped and perhaps didn’t come through intact. I’ve zipped and reattached here. Note that assuming we get jit.lcd solution to iterate without crashing, the down side to jit.lcd for me is that apparently I can’t (at least easily) specify the dims of jit.lcd on the fly.
Where do we go from here? There’s got to be some manageable solution to this in the Jitter bag o’ tricks somewhere! Your help is very much appreciated!
Feb 9, 2007 at 8:59pm
On Feb 9, 2007, at 11:40 AM, Jeff Burger wrote:
> Thanks, Joshua. Unfortunately, this solution doesn’t appear to work
This is most likely a limitation of your graphics card. With a Radeon
However using the high quality software renderer you should be able
> Since I’m only importing hi-res still photos, I tried modifying
Could use jit.qt.movie @movie_dim 1 to automatically adapt to the
#P window setfont “Sans Serif” 9.;
Feb 10, 2007 at 12:09am
Feels like we’re getting close!… but I’m still having problems with your last post. (For anybody else reading, you need to remove the space before the last part of the provided URL for starters.)
On G5 w/ Radeon 9600XT, I get images in pwindows and filter control. The processed image doesn’t seem noticably sharper to me. Could have something to do with the stream of error messages Max is spitting out?:
>error: jit.gl.readback: unable to create framebuffer: pbuffers not supported!!
So I decided to try it on new MacBook Pro 17″ w/ 2MB RAM and Radeon X1600 w/ 256MB VRAM. Yielded imagery again along with variations on the error messages:
> error: jit.gl.pbuffer: error binding invalid pbuffer!
Are these message a concern?
Can you explain what aspect of this routine forces software rendering?
Not sure I understand when you say your patch doubles size rather than halves it?
Can you point to or list your gaussian upsampling patch you refer to?
Re your suggestions of jit.qt.movie @movie_dim 1, Max tells me:
>jit.qt.movie: “movie_dim” is not a valid attribute arguement.
Finally, your comments about graphics cards cause me to look for an upgrade on my G5. What qualifications am I looking for to take advantage of GPU and OpenGL manipulation of at least 4k x 4k? AGP 8X? 256MB? Radeon 9600 Pro (PC & Mac Edition w/ 256MB?)
Thanks SO much! :)
Feb 10, 2007 at 12:37am
On Feb 9, 2007, at 4:09 PM, Jeff Burger wrote:
> On G5 w/ Radeon 9600XT, I get images in pwindows and filter
It should not be sharper. It should be blurrier. This is what anti-
For more info on different filters, I’ll need to direct you to online
> Are these message a concern?
Hmmm. Try upgrading to 10.4.8 if you haven’t already, and perhaps
> Can you explain what aspect of this routine forces software rendering?
Using a jit.matrix object as the rendering target. Please read the
> Not sure I understand when you say your patch doubles size rather
Previous post I sent, the one I just sent actually quarters the size.
> Can you point to or list your gaussian upsampling patch you refer to?
Sorry, movie_dim is the gettable movie dimensions. I meant @adapt 1.
> Finally, your comments about graphics cards cause me to look for an
I’d recommend an NVidia 6800 or ATI X800 of one variant or another if
All the specs for 4096×4096 textures and render destinations
Here’s the PPC version of that page I sent in case it wasn’t obvious:
xlr8yourmac.com is a good resource to find out more about the
Hope this is enough info for you to go on since I’ll need to drop out
Mar 5, 2007 at 6:38am
Thank you for your feedback, Joshua. It took me a while to locate a graphics card with the right specs, but between that and the upgrade to the latest Jitter beta, I seem to be in much better shape now!
You must be logged in to reply to this topic.