This Filtering Worthwhile?

cybamerc said:
Humus said:
This is why for instance Paint Shop Pro when resizing with the "smart resize" option uses bicubic for magnification and bilinear for minification.
Well, it's been a while since I used PSP but with Photoshop it's the other way around. Bicubic is superior for downsampling while bilinear works better for upsampling. I've also noticed that Photoshop generates a far less blurry result when using bicubic filter than the examples Nick linked to. So either Photoshop's bicubic implementation is indeed wrong (which I doubt) or the other apps add a little blur to remove jaggies and halo effect.

Well, I just compared with Photoshop and found first of all that Photoshop ignores the dropdown menu with filter selection and selects filter method itself depending on if we're upsampling or downsampling. Changing anything on that menu did not alter the output the slightest, but the results were otherwise as I expected. The upsample looks identical to PSP's bicubic, but clearly different from the bilinear, and the downsample looks identical to PSP's bilinear and clearly different from the bicubic. And in each case the bilinear provided better results on downsampling and bicubic on upsampling.
 
cybamerc said:
The halo artifact is shown quite clearly here. A bilinear filter would produce a much better result.
I'm not so sure. A bilinear filter would be much more pixellated.
 
MaxSt said:
I incorporated hq3x into ZSNES emulator a couple of weeks ago.
Just download the latest unofficial release and see for yourself.
Will do. Thanks!
 
Humus:

> Well, I just compared with Photoshop and found first of all that
> Photoshop ignores the dropdown menu with filter selection and selects
> filter method itself depending on if we're upsampling or downsampling.

I'm not sure I understand. Are you saying that it disregards your choice of resampling method in the Image Size menu? If so something isn't right. Try deleting the Photoshop preferences or if that doesn't work reinstall the app. Which version are you using?

If you are talking about the transform option then it automatically uses the method you have chosen in the preferences (bicubic is default when installing the app) but it doesn't distinguish between up- and downsampling.



Chalnoth:

> I'm not so sure. A bilinear filter would be much more pixellated.

In Photoshop using the bilinear filter on that image wouldn't produce more aliasing. You would however get rid of the halo. In fact I'd say in most situations, if not all, when upsampling I can achieve a similar result as using a bicubic filter by using bilinear and tweaking with unsharpen mask filter afterwards.
 
cybamerc said:
In Photoshop using the bilinear filter on that image wouldn't produce more aliasing. You would however get rid of the halo. In fact I'd say in most situations, if not all, when upsampling I can achieve a similar result as using a bicubic filter by using bilinear and tweaking with unsharpen mask filter afterwards.
I'd say that tweaking with an unsharpen mask is the key there. That's not something you do with realtime rendering (which is what this forum is dedicated to, right?).

But no, there wouldn't be more aliasing. But that doesn't mean it wouldn't look more pixellated. I think this link, posted near the beginning of this thread, shows pretty well what bicubic can do to remove the pixellation of edges: http://www.vrvis.at/vis/research/hq-hw-reco/results.html
 
I'm not sure if we're supposed to take Photoshop as the authority here. It's not clear whether it is using plain bicubic or does additional stuff too. Personally I'm more interested in how bicubic would look when used in hardware and real games.
 
Humus said:
I'm not sure if we're supposed to take Photoshop as the authority here. It's not clear whether it is using plain bicubic or does additional stuff too. Personally I'm more interested in how bicubic would look when used in hardware and real games.
I fully agree. It's undoubtedly fantastic software but you still have an artist controlling every action and visually deciding what looks better. Furthermore it only processes static images, where temporal aliasing does not exist.
 
Humus said:
I'm not sure if we're supposed to take Photoshop as the authority here.

Then who is an authority?

Humus said:
Personally I'm more interested in how bicubic would look when used in hardware and real games.

For low-contrast images both bilinear and bicubic are pretty good.

How they handle sharp edges in much more interesting:
1. Bilinear - makes them blurry, with jaggies.
2. Bicubic - makes them as blurry as bilinear, but withous jaggies. Sometimes adds halo effect.
3. The smart filtering's goal is to mage edges sharp, without jaggies.

MaxSt.
 
MaxSt, I'm curious, do you know how your "hq3x" filter compares to the "Super Eagle" filter available in ZSNES?

After just a cursory look, it seems like the end results are quite similar, but with one key difference: hq3x appears to be more general in how it upsamples images, whereas Super Eagle only seems to want integer multiples. Just curious if you had any more insightful take on this.
 
Chalnoth said:
MaxSt, I'm curious, do you know how your "hq3x" filter compares to the "Super Eagle" filter available in ZSNES?

Well, ZSNES crowd is definitely in love with hq3x. :)
Just download the latest (unofficial) ZSNES release and see for yourself.

MaxSt.
 
MaxSt said:
Well, ZSNES crowd is definitely in love with hq3x. :)
Just download the latest (unofficial) ZSNES release and see for yourself.

MaxSt.
I did. I asked because I'm having trouble seeing the differences.
 
MaxSt said:
2. Bicubic - makes them as blurry as bilinear, but withous jaggies. Sometimes adds halo effect.
That sounds like negative coefficients in that particular filter. You can just use positive weights which'd be slightly blurrier but shouldn't have the ringing.
 
Simon F said:
That sounds like negative coefficients in that particular filter. You can just use positive weights which'd be slightly blurrier but shouldn't have the ringing.
Nah. I'll try to describe what I think to be about the best bicubic filter.

I'll describe it in a 1-D fashion.

The point that is being sampled should lie somewhere between samples 2 and 3 (out of 4). The value of the function (in the case of texture, that means color) at the two nearest points will determine two of the fitting points.

Two other positions could be taken from the 1 and 4 samples, but that's not the best way. In particular, bicubic can be both continuous (the fitting function will always pass through the nearest two sample points), and its first derivative can be continuous (the fitting function's slope doesn't change abruptly because the slope is used for the other two sample points).

That is, a cubic function is defined uniquely if four values are specified. Those values can be the values of the function at various points, or the values of the first, second, or third derivatives (Note: no higher derivative could be used as a sample point unless at least one lower derivative were used...). The easiest is the first derivative, since that is just the slope of the function. The second derivative is related to curvature, and the third related to the rate of change of curvature.

What this means is that a cubic function can be uniquely specified simply by taking the sample position and a slope. The easiest way to get a slope is to draw a line from sample 1 to sample 3 (for the slope at sample point 2), and another line from sample 2 to sample 4 (for the slope at sample point 3).

What is the implication of this?

Imagine a step function:
Code:
.  .  .
        .  .  .
Now, imagine that we're taking a sample just to the right of the step, between the first two samples to the right that have the same value. The slope for the sample on the left will be negative, since sample 1 is above sample 3. This means that since the value at sample point 2 is zero, and the slope is negative, moving just to the right of sample point 2 will reduce the value of the function. It will "overshoot" the ideal value.
 
I was just suggesting using an approximating curve (eg like a uniform B-Spline) rather than a interpolating curve ( eg Catmull-Rom Spline.)

I know the latter overshoots because it has negative weights and therefore won't stay inside the convex [edit] hull [/edit] of the control points.
 
Chalnoth said:
MaxSt said:
Well, ZSNES crowd is definitely in love with hq3x. :)
Just download the latest (unofficial) ZSNES release and see for yourself.

MaxSt.
I did. I asked because I'm having trouble seeing the differences.

Depends on a game. Try Super Mario World or Zelda.
Super Eagle is too blurish, while in hq3x there is practically no blur - only AA.

Also be sure your monitor isn't playing it's own bluring tricks with you.

MaxSt.
 
Simon F said:
MaxSt said:
2. Bicubic - makes them as blurry as bilinear, but withous jaggies. Sometimes adds halo effect.
That sounds like negative coefficients in that particular filter. You can just use positive weights which'd be slightly blurrier but shouldn't have the ringing.

"slightly blurrier"?
I wrote the filter that eliminates bluring of edges, and that's the point.
Why would I like the opposite?

MaxSt.
 
Back
Top