4 ms·
I can see why you should look at pixels as point samples when resampling a picture. However, if I'm sampling, say, a fractal to make a picture, I can't see a b
by bajsejohannes 12y ago
I can see why you should look at pixels as point samples when resampling a picture.
However, if I'm sampling, say, a fractal to make a picture, I can't see a better way than to sample in the square (assuming it's grayscale) that each pixel provides. Should I do a gaussian sample instead?
- fsloth 12y ago"Should I do a gaussian sample instead?" There are a ton of sampling filters. The main metric of quality for them is how they look (or rather, how the image looks after being processed by them). So if the square looks nice, there's absolutely nothing wrong with it. However, if you feel like geeking out, as resampling filters go, the last time I looked the "best" by some empirical estimate was the Mitchell-Netravali filter (they did a "scientific" sampling of asking a bunch of computer graphics people what they thought looked best). There's a paper http://www.cs.utexas.edu/~fussell/courses/cs384g-fall2013/lectures/mitchell/Mitchell.pdf http://www.cs.utexas.edu/~fussell/courses/cs384g-fall2013/le... and an entry in the german (no english page!) wikipedia http://de.wikipedia.org/wiki/Mitchell-Netravali-Filter http://de.wikipedia.org/wiki/Mitchell-Netravali-Filter Gives the brief definition
- jacobolus 12y agoThe best resource about this I know of on the web is: http://www.imagemagick.org/Usage/filter/ http://www.imagemagick.org/Usage/filter/ and also see http://www.imagemagick.org/Usage/filter/nicolas/ http://www.imagemagick.org/Usage/filter/nicolas/ The Mitchell–Netravali paper is definitely not the last word on the subject.
- bajsejohannes 12y agoThanks! (And thanks for the other replies as well) This resource is the most interesting to me. As I got a lot of answers about zooming and resampling, I'll try to restate my original question: What I have is some mechanism to sample something as much and as detailed as I want. This is why I mentioned a fractal. I don't want to zoom or resample, just find the optimal way to sample the original data to construct, say, a 500x500 pixel image. Up until I read this article, I would just sample randomly in the [0.0, 0.0]-[1.0, 1.0] space and avergage out the value. If there's a better way, I'd love to learn it. The best answer might just be "main metric of quality for them is how they look" from fsloth.
- jacobolus 12y ago> Up until I read this article, I would just sample randomly in the [0.0, 0.0]-[1.0, 1.0] space and avergage out the value. What does it mean to sample “random” points in a fractal? In practice you’re probably sampling in terms of numbers at some specific precision (e.g. the limit of your floating point type for the range in question). This is still going to be points in some particular discrete lattice. Depending on the way the fractal is constructed, this could bias your picture. Again, I’m not sure that the color of an “area” is meaningful for a fractal. But yeah, I think fsloth has the right idea: if the purpose of the images is to be pretty, then do it in whichever way gets you results you prefer.
- ska 12y agoTechniques like the chaos game are used to sample according to the associated fractal measure, which addresses the issue of bias. Issues or floating point representations and the like are a separate problem, but you can address them also.
- corysama 12y agoResampling techniques can be context-specific (ex:HQ4X for pixel art) and fractals are an interesting context. I can give two points of view on that: 1) If your image is composed of point samples into an infinitely detailed and completely unpredictable equation, then what's between the samples is unknowable. When zooming, you should stick with single-pixel dots and fill in the spaces between with black or a checkerboard or some other way to indicate "unknown". 2) If your equation is understood to demonstrate a significant degree of local similarity (the area between samples usually resembles the surrounding samples) then, yes a Gaussian reconstruction filter is probably more accurate than point sampling for the task of predicting what the area between samples would look like if you took the time to run the fractal equation for real.
- jacobolus 12y agoIf you’re rendering a fractal, you can usually just look at the point directly under the center of each pixel (arguably that point “is” the pixel). (With a fractal, I’m not sure the color of an area is even a meaningful concept. If you find that it makes your picture look better, you could always render the fractal at a larger size and then downsample using whatever method you prefer.)
- physPop 12y agoHmm.. I think in the case of a fractal its actually easier, since you'd typically not resample, but instead recompute the fractal iteration count. Consider the case of zooming in on a region of the fractal. Do you: a) only zoom by fixed integer scalings? or b) have an arbitrary scale represented by a float? In the case of b, this means you need to re-compute what the (fractional) pixel locations are that would correspond to the fixed image size of your viewport. We can regenerate the fractal given these new sampling locations.