![]() There is a good example of the results of various algorithms at Cambridge in Color. But as usual, it depends on the image and what you want: shrinking a line drawing to preserve lines is, for example, a case where you might prefer an emphasis on preserving edges that would be unwelcome when shrinking a photo of flowers. Lanczos is one of several practical variants of sinc that tries to improve on just truncating it and is probably the best default choice for scaling down still images. It probably refers to a truncated version of sinc. But sinc is a theoretical filter that goes off to infinity and thus cannot be completely implemented, so I don't know what they actually meant by 'sinc'. The results were that for these pros looking at huge motion pictures, the consensus was that Mitchell (also known as a high-quality Catmull-Rom) is the best for scaling up and sinc is the best for scaling down. Unfortunately, I cannot find a link to the original survey, but as Hollywood cinematographers moved from film to digital images, this question came up a lot, so someone (maybe SMPTE, maybe the ASC) gathered a bunch of professional cinematographers and showed them footage that had been rescaled using a bunch of different algorithms. This would naturally be computationally intensive, but it should be as close to the ideal as possible, no? ![]() So, if a target pixel would cover 1/3 of a yellow source pixel, and 1/4 of a green source pixel, I'd get (1/3*yellow + 1/4*green)/(1/3+1/4). Then, to get the color of the target pixel, one would simply calculate the average of these colors, adding their areas as "weights". It would then be possible to calculate the areas and colors of these pixels. It would probably overlay one or more other pixels. The idea is this - for every pixel in target picture, calculate where it would be in the source picture. I suppose it also has a name (as something this trivial cannot be the idea of me alone), but I couldn't find it among the popular ones. It also reminded me of an algorithm I had "invented" myself, but never implemented. That makes me wonder if interpolation algorithms are the way to go at all. I checked out Paint.NET and to my surprise it seems that Super Sampling is better than bicubic when downsizing a picture. ![]() Unfortunately I would like to use this algorithm myself in my software, so Adobe's carefully guarded trade secrets won't do. I know of bicubic, but is there something better yet? For example, I've heard from some people that Adobe Lightroom has some kind of proprietary algorithm which produces better results than standard bicubic that I was using. With best I mean the one that gives the nicest-looking results. I want to find out which algorithm is the best that can be used for downsizing a raster picture.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |