Wednesday, March 02, 2022

SuperResolution using Rawtherapee "Capture Sharpen" and Gimp Up-Sizing ~ Part Two ~ starting with a synthetic image

Living where I do, I _know_ very much how fortunate I am to live in peace.  There is mental space and physical safety to do the things I want.  Like write these little blog entries.  Not everyone has this option these days.  I wish peace for everyone.

-------------------------

Years ago I wrote my first blog entry on the topic of "SuperResolution."  A lot has changed since then with my knowledge on the topic having been greatly improved.

For example, I learned that when using the Gimp's Cubic (BiCubic in Photoshop parlance) interpolation using 300dpi or 360dpi sample (resolution) slices produced blocky, pixelated  images and were no better than the simplest linear up-size function.

Setting image size resolution to 1200 dpi sample slices for 1.5x linear/3x area (ie: 6000x4000 to 9000x6000 pixel) up-sizing can give a fairly nice, crisp looking image.  

2x linear/4x area (ie: 6000x4000 to 12,000x8000pixel) up-sized work, however, remained a challenge and were "soft" to my eyes when using the Cubic/BiCubic interpolation algorithm mated with the UnSharp Mask sharpening function.

Recently I noticed that the latest Gimp version includes two new to me image size change interpolation algorithms.  They are "NoHalo" and "LoHalo".  

How long have they been there?  I have no idea, but I decided to give them a try just in case I was missing something.

From Graphic Design  I learned that -

"...NoHalo and LoHalo are the new GEGL samplers, developed by Nicolas Robidoux to reduce the blur in the resampled images..."

Gimp NoHalo interpolation - "...NoHalo level 1 consists of one diagonal straightening subdivision followed by bilinear interpolation...

...LoHalo is described as a sigmoidized EWA (Elliptical Weighted Averaging) with the Robidoux bicubic for upsampling, blended with non-sigmoidized EWA Robidoux for downsampling..." 

So I decided to see how NoHalo compared with Cubic interpolation in up-sizing by 2x (linear) a synthetic 500 x 1000 pixel image. 

Since LoHalo seemed to be dedicated to down-sampling I took only a cursory look and returned quickly to working with NoHalo.

I created the synthetic image in the Gimp knowing that pixelation and related artifacts would raise their ugly heads and felt it would be interesting to see how the two up-size algorithms, Cubic and NoHalo, compared with each other.

 

Synthetic Image -

The image consists of three blocks of solid color.  They are oriented at 0, 23, and 45 degrees of inclination.  I added several 1 pixel wide straight lines oriented along the X, Y axis and two lines randomly oriented.  As you can see, there is some heavy pixelation going on with the randomly oriented lines. There is a dot in the scene as well.

I took the resultant 500 x 500 pixel image, inverted its color, and put the two images side by side.  It is this 500 x 1000 pixel image that I up-sized.

As you can easily see, I performed a Cubic up-size, then added a 1 pixel USM.  These are followed by a NoHalo up-size and then a 1 pixel USM.

[As always, click on the image and open at 100percent to pixel-peep.  In fact, open this at 400percent to see some rather interesting things that I will describe below.]

 

Gimp Up-Rez Sythetic Test In BW ~ Compilation

 

Comments -

Note: Keep in mind that we are _not_ adding detail to an image by performing an up-size.  In this way, I feel uncomfortable talking about Up-Rez'ing an image.  Up-Sizing, yes.  Up-Rez'ing, no.  If the information isn't there in the base file, then it certainly will not be there in the up-sized image, either.  

Looking carefully at the Cubic up-sized images, the edges are slightly "soft" in all orientations.  This continues with when a 1 pixel wide UnSharp Mask applied.  The randomly diagonal lines are not crisp and clear.  Black lines appear smaller than up-sized white lines.

I think we can account for these effects when we consider how a Cubic interpolation operates.  It uses 16 pixels to generate one interpolated pixel.  This I imagine is good when dealing with gradient areas, but going from pure white to pure black, and vice versa, we see the influence of averaging across a comparatively wide area (ie: the 16 pixels).

Looking at the NoHalo interpolation, I feel the simple up-sized image is already "sharper" looking than the 1 pixel USM'd Cubic up-size.  Adding a 1 pixel USM to the NoHalo image, to my eyes (and, yes, they are getting old, so YMWV) is correct and sharp.

In Part Three of this series, we'll have a look at how NoHalo can perform in the "nearly real world."

No comments: