Showing posts with label rescaling. Show all posts
Showing posts with label rescaling. Show all posts

Thursday, April 26, 2012

Technical implementations of upscaling

Question

So I've seen bicubic and fractal listed as methods of upscaling photos. What's the technical details behind how these work and why/when is one better than the other?

Asked by rfusca

Answer

First off, image enlargement involves moving pixels apart by a fixed amount, and filling in the space between previously neighboring pixels with similar content. This can be done through basic pixel fabrication (bicubic filtering), or via more complex means, such as converting the image into a vector representation, and scaling in vector space.

Bicubic filtering, along with Bilinear filtering, use a relatively simple function curve to blend the colors of neighboring pixels together when you enlarge an image. Bilinear uses a linear function curve, while Bicubic uses a cubic spline function curve (cspline). Bicubic filtration generally produces smoother results, however both algorithms are ultimately blending the values of neighboring pixels together via a function curve to "fill in the gaps" when enlarging an image. It should be noted that bicubic scaling is generally lossless, in that only the space between original pixels is really generated. Depending on the nuances of specific implementations, the original pixels may change slightly, however for the most part, original data is preserved and new data is fabricated to fill in as an image is scaled up. Excellent scaling can be achieved up to around 200% or so, however beyond that, visible edge softening begins to exhibit.

The fractal approach to image scaling takes an entirely different approach. More complex algorithms are employed to analyze the contents of an image, identify edges and "objects", and ultimately convert the image into a fractal vector format. Once the image is vectorized, it can be scaled "lossless" in vector space, then re-rendered at a larger size. Fractal algorithms, such as Genuine Fractals, use a fractal vector algorithm to scale an image while maintaining smooth, sharp edges. This approach is useful when your image initially has sharp and recognizable edges as a key factor, and maintaining clear sharpness on those edges is important.

Additionally, Genuine Fractals attempts to maintain non-edge detail via the concept of "self similarity", preserving detail by considering the image content to be fractal in nature, and re-rendering non-edge content from fractal algorithms. This has the presumed benefit of, rather than simply fabricating information from neighboring pixels, new content can be generated from patterns composed of many pixels. This approach can work great when upscaling by around 200%, however the fundamental vector nature of scaling becomes more apparent when scaling to larger sizes. It should also be noted that this scaling method is not lossless, and some fine pixel detail may be discarded as the algorithm tries to find fractal patterns that can be replicated. Extreme upscaling can result in visible pattern replication, and fine edge detail may be wiped away in the effort to maintain smooth, sharp edges at all image sizes.

BenVista also provides a proprietary algorithm dubbed S-Spline. There is little information about the specifics of this algorithm, however it does seem like another function curve based algorithm. The S-Spline Max scaling in PhotoZoom Pro, like Genuine Fractals, does a superb job maintaining edge definition. This algorithm is also capable of scaling to around 200% or so, however pushing this algorithm much farther results in visible non-edge detail degradation and smoothing. It seems the general compromise in scaling algorithms is either maximim edge definition, or maximum detail preservation. It should also be noted that most third-party scaling algorithms, including Genuine Fractals and BenVista PhotoZoom Pro, automatically apply an unsharp mask to the final image by default. Any comparisons between bicubic and a third-party algorithm should always be done AFTER applying a modest unsharp mask to the bicubic version.

It is possible to use bicubic in an iterative fashion. The fundamental crux of bicubic scaling is that it fabricates more information the larger you scale, at the ultimate cost of sharpness. By performing bicubic scaling in 3-5% incrments, you preserve far more original or near-original detail, and fabricate much less of the image at each step. The final results of an iterative (or stepped) bicubic scaling can maintain considerably greater edge definition, without losing fine detail. The cost, however, is far greater personal investment in scaling, as at the moment, there are no prefabricated applications that will do this for you. You need to manually calculate the new width and height of the image at each step by multiplying the previous width or height by your scaling percentage, and plugging that number into your image editing program's bicubic scaling tool. The end results can be superb, and as sharp as a bicibic image w/ unsharp masking. The limits for how much larger you can scale an image without visible detriment is much greater than other algorithms, at least 400%, possibly more.

Answered by jrista

Sunday, April 15, 2012

How can I export reduced resolution RAW files from Lightroom?

Question

I read that in Lightroom 4 is possible to export reduced resolution raw files.

Does anybody know how to do it?


Thanks to Rob's links I found the solution.

Export the photo with the following settings:

  • Image format: DNG
  • Compatibility: Camera Raw 6.6 and later (required otherwise the lossy compression doesn't show)
  • Use Lossy Compression: Checked

For a Canon 7D raw files this process reduce the size at about the 25% of the original. I think I just found a good solution for bringing my photos with me on my laptop while keeping the original raws on my desktop computer.

Asked by Ghigo

Answer

Having done some research on the Adobe Lightroom help site I found this article on how to export to file.

http://help.adobe.com/en_US/lightroom/using/WS75C39DDC-B701-4840-A703-0755A5C04878.html

I believe the feature you are referencing to is to do with

Enhanced DNG options

  • Resolution reduction via export provides the ability to share lower resolution versions of the original raw file without losing the capabilities offered by raw.

http://blogs.adobe.com/lightroomjournal/2012/01/lr4betanowavailable.html

Answered by Rob

Friday, March 16, 2012

Does size reduction in a fine quality JPEG photograph introduce noise?

Question

Does size reduction in a fine quality JPEG photograph introduces noise?

I use Gwenview to reduce the size of the JPEG photographs. Does that cause some noise introduction?

Asked by Anisha Kaul

Answer

In essence, no. That is, if you are referring to grain like noise such as what you see with higher ISO images. What you have with saving/resaving jpegs (especially at diffrerent quality levels) is artifacting. You can read about it here: http://en.wikipedia.org/wiki/Compression_artifact. The more aggressive the compression with jpeg the more data is thrown away (as mentioned in the earlier answer) and thus more visual artifacts are created.

I'm not familiar with the tool you mention but the best thing is use a higher quality setting (if available) for images that have lots of smooth areas (as those tend to be areas that get artifacts) or for ones with lots of detail you want to make sure is in the final image.

Answered by nwcs

Tuesday, November 1, 2011

How could I prevent involuntary resize of pictures by Flickr?

Question

I have a borderline question again, but it's a real problem for me.

I have noticed that the original sizes (1000px) of my older pictures on Flickr are no longer available and the biggest size is now 640px. The downsized versions of the pictures are also oversharpened.

I don't have pro account.

Is this a normal practice? Does it depend on the amount views or anything else? I couldn't find any information from their help pages nor Terms and Conditions. What should I do to avoid it?

Answer

Flickr changed their behavior regarding originals for non-Pro users a few months ago. Before, if your original upload was smaller than 1280 px on the wide side, they would not generate a large (1024 px) version and show the unedited original as the large version instead. Now, they don't do that anymore.

See this thread on the Help Forum for reference.

Saturday, October 29, 2011

What DPI should I resize my image to for best printing quality?

Question

And my apologies if this sounds a bit too basic but I can't get my head around this.

I have a digital image I took with my camera. 4000x3000 pixels, and GIMP claims that its resolution is 72x72 DPI.

I would like to print a thumbnail of this picture in the highest quality possible. What I was told is that the printer which is going to be used works optimally with images set for 300 DPI.

In the printed document, I would like my image to be exactly 166 pixels wide, or 3.32cm (as Microsoft Word sets it).

And now to the question: how do I calculate how to resize my 12MP image, so when I take that image and import it into my word processor, it will end up printing the best?

My initial thought was this: Since the image on paper is going to end up being 3.32cm wide (1.31"), I should resize my image to be 300x1.31 = 393 pixels wide and set its DPI headers to note "300x300".

However, I'm pretty clueless about photography in general so I'm afraid this sounds as if I'm smoking something cheap.

Am I missing anything?

Answer

When it comes to print, terms like DPI, resolution, PPI, etc. get thrown around without much care or concern as to what they truly mean. So, before I send you off to a more in-depth answer about DPI, PPI, resolution, and print, a quick summary:

  • DPI: Dots Per Inch
    • A 'dot' is a single element of a pixel
    • On a computer screen, a dot is a single 'sub-pixel' element, and may be red, green, or blue
    • On a print, a dot is a single droplet of ink expelled by the print head
  • PPI: Pixels Per Inch
    • A 'pixel' is the smallest element of an image, "PIcture ELement"
    • On a computer screen, every pixel is composed of three 'dots' or sub-pixels, one red, one green, one blue
    • On an ink jet print, every pixel is composed of numerous dots of varying ink colors, usually a mix of cyan, magenta, yellow, and black, although modern printers often have several other inks as well
    • On a dye sublimation print, every pixel is a single dot from a blend of varying in colors, such as cyan, magenta, yellow, and black.
  • Resolution: Variable meaning
    • Regarding an image, the resolution usually means the width and height of an image in pixels
    • Regarding a print, the resolution usually means the number of pixels in an inch (or cm, if you are from a country that uses metric.)
    • Regarding a computer screen, resolution usually means the width and height of the screen in pixels, but can also mean pixels per inch (i.e. 72ppi is the common "resolution" of the average LCD screen, while higher end screens often have a resolution of 100ppi.)

To answer the rest of your question, I've written up an extensive article here on Photo-SE that answers that question in great detail:

Monday, July 11, 2011

Is it possible to increase the pixel density of an image ?

Question

I have taken a picture whose resolution is less. I can resize the image easily (i.e I can scale to higher resolution) but the image quality goes for a toss, which is true because the image might not have enough pixels to scale properly.

  1. Is resizing a means to increasing the resolution of the image ?

  2. Is it possible to increase the pixel density of the image and then resize, so that
    quality of the image is not affected much?

I mainly use GIMP and Picasa.

Answer

In general it is not possible to increase the size/resolution/pixel density of an image after it has been captured. If the detail was never present it can't be replaced.

There are ways to increase the number of pixels whilst minimizing artifacts (an example being fractal based image resizing). These methods are useful when you need to print large without seeing pixel artifacts. But the results are nothing like what you'd get with an image that was higher resolution to start with.