Pages: 1 2 3 [4] 5   Go Down

Author Topic: Most favourable up-ressing percentage  (Read 55615 times)

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: Most favourable up-ressing percentage
« Reply #60 on: June 25, 2014, 11:44:04 am »

Bart:
I am starting to see why you like (I think) EWA Robidoux. Here is what is does with sigmoidization.

Hi Nicolas,

They are all a compromise, but Robidoux (the filter, I wouldn't dare judging you ;) ) is a reasonable one by design, but there are others. The additional Sigmoidization is a bit of a hack, but it works (although the best values can differ depending on image content).

Quote
magick QuarterZoneplate.png -set colorspace sRGB -colorspace RGB +sigmoidal-contrast 5,84% -distort Resize 230% -sigmoidal-contrast 5,84% -colorspace sRGB -quality 99 230.robidoux.s.5.84.jpg
Not very different from your own. The one's that's different is the one obtained by enlarging directly through linear light, which of course is generally not recommended.

Yes, this shows that (angle independent) preservation of the same amount of resolution that I like, which looks quite natural for well behaved images. The upsample is without too many artifacts (there is a slight amount of moiré, due to gamma or source?).

As a photographer, I prefer natural looking images (artifacts draw attention away from content and creative intent), although viewing distance may be exploited to hide some artifacts that benefit other aspects of perceived image quality. If e.g. stairstepping is too small to be resolved by eye, but it does allow to enhance edge acutance, then I have no problem with that.

Something I also tend to keep in mind is this 1995 Tech memo by a Microsoft employee.

I also think that a relatively soft and artifact-'free' upsampling can be very well combined with subsequent deconvolution, although that will be computationally more expensive at the larger size.

Cheers,
Bart
« Last Edit: June 25, 2014, 11:48:31 am by BartvanderWolf »
Logged
== If you do what you did, you'll get what you got. ==

Jim Kasson

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2370
    • The Last Word
Re: Most favourable up-ressing percentage
« Reply #61 on: June 25, 2014, 12:55:11 pm »



Something I also tend to keep in mind is this 1995 Tech memo by a Microsoft employee.

Not just any Microsoft employee. PARC, too. Founded Pixar.

You were playing with us, right?

Marvelous, Bart. Thank you.

Jim

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #62 on: June 25, 2014, 01:02:19 pm »

Bart:

Interesting and useful comments and tech report. (Who knew MS employees could be so spunky?).

I agree that often resampling "softly", leaving sharpening for a later stage of the toolchain, is desirable. (This is why I now recommend also the plain EWA Lanczos, not only EWA LanczosSharp 3, LanczosRadius 3 or LanczosSharpest 4, and why I am planning to put RobidouxSoft into ImageMagick.)

I also agree that as it stands now, sigmoidization should not be used "blindly". My opinion is that there is a good idea in there, but the implementation is blunt.

As for "natural looking", I have found that what people find pleasing (or even natural) in (digital) photographs is all over the place. I would bet that what most people find natural and pleasing is different now than it was 20 or even 5 years ago. Cartoon: Pixel art now looks natural.

Resampling is complicated by the lack of standardization of personal tastes.

As for "viewing conditions"... (grin)

Thank you (again),

Nicolas (a reasonable one by design, but there are others)
« Last Edit: June 25, 2014, 01:27:09 pm by NicolasRobidoux »
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: Most favourable up-ressing percentage
« Reply #63 on: June 25, 2014, 02:12:17 pm »

Not just any Microsoft employee. PARC, too. Founded Pixar.

You were playing with us, right?

Hi Jim,

Couldn't help myself. Understatement often works better ...

Here is some more background about Alvy Ray Smith.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

Jim Kasson

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2370
    • The Last Word
Re: Most favourable up-ressing percentage
« Reply #64 on: June 25, 2014, 03:01:39 pm »

Here is some more background about Alvy Ray Smith.

I once participated on a SIGGRAPH panel on color management organized by Efi Arazi. Smith was a follow panelist. It was a humbling experience. A giant.

Jim

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #65 on: June 28, 2014, 09:58:40 am »

...The upsample is without too many artifacts (there is a slight amount of moiré, due to gamma or source?)...
The sigmoidization values were settled on really quickly so may not be best. (On the other hand the fact that I don't know right off the bat says a lot.) In any case, I am wondering if the "kink" in the S-curve is to blame for the slight moire.
Maybe blending two enlargements, one with a well chosen gamma, the other one with a possibly different gamma >>applied to the negative of the image<< would be a better (but more complicated and expensive) strategy toward avoiding destructive overshoots using a linear filter with negative lobe(s) than using a single S-curve?
That is: Filter within two "kink free" colorspaces, one that suppresses dark halos, the other one that suppresses light halos (gamma "corrected" negative) and blend the results back in linear light.
Something like that was very quickly tried in the early days of sigmoidization. Maybe worth revisiting.
When I have "a minute", I'll have to try.
« Last Edit: June 28, 2014, 10:52:46 am by NicolasRobidoux »
Logged

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #66 on: June 29, 2014, 11:17:35 am »

Here is another way of looking at it, I've plotted the noise power spectra of the up-sampled uniform noise image. The images were upsampled with the state of the art EWA algorithm, with the default ImageMagick Robidoux filter.


...
These plots may illustrate why EWA Robidoux probably should not be used to enlarge more than 250% or so unless the image is "soft": This is where the power spectrum goes from being monotone (the higher the frequency, the lower the "response") to having local "peaks". These peaks are low, but nonetheless I would guess that their impact can be seen, at least if one can "pixel peep".
P.S. Of course the fact that EWA Robidoux takes its sweet time to drop near Nyquist...
« Last Edit: June 30, 2014, 02:48:48 am by NicolasRobidoux »
Logged

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #67 on: June 29, 2014, 11:20:52 am »

« Last Edit: June 29, 2014, 01:45:49 pm by NicolasRobidoux »
Logged

hjulenissen

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2051
Re: Most favourable up-ressing percentage
« Reply #68 on: July 03, 2014, 09:42:31 am »

Not sure if I have linked this whitepaper, but I find it interesting since it involves viewers and finding detectability thresholds.
http://downloads.bbc.co.uk/rd/pubs/whp/whp-pdf-files/WHP092.pdf

They find that one can live with slightly lower transmitted resolution in tv systems if some sharpening is applied at rendering.

-h
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: Most favourable up-ressing percentage
« Reply #69 on: July 04, 2014, 06:30:50 am »

I put a first sample of filtering through an extreme "gamma space" for the purpose of image enlargement as a P.S. to http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=21804&p=89751#p89751.
Two more: http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=21804&p=89728#p89728 and http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=21804&p=89728#p89746, in the P.S. too.

Hi Nicolas,

Very interesting results. A warning (as you did add) is indeed appropriate, because more images would need to be tested (although I suspect most would survive just fine), but more so because you use an "HDR version" of ImageMagick which is not available as pre-compiled binaries for regular users. The extreme temporary gamma adjustments require floating point calculations for the image to survive.

Nevertheless, it's an interesting angle to look from at the general task of upsampling.

Cheers,
bart
« Last Edit: July 04, 2014, 06:42:34 am by BartvanderWolf »
Logged
== If you do what you did, you'll get what you got. ==

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: Most favourable up-ressing percentage
« Reply #70 on: July 04, 2014, 06:41:03 am »

They find that one can live with slightly lower transmitted resolution in tv systems if some sharpening is applied at rendering.

It's interesting (but not surprising from how our retina is structured) to see how many tests keep confirming the 0.7 - 1.0 minutes of arc as practical resolution limit for viewing. That's why I chose those values in section 1.1 of my DOF Output Quality Planner.

The BBC paper also shows that sharpening of the output can help lower resolution input, but that should hardly come as a surprise.

The lesson one may draw from all that is also that some artifacts may be tolerable when viewed at a small enough scale. However, for large format output, which is why we usually up-sample, small artifacts may become large enough to be seen. So in general, fewer artifacts are better, and subsequent high quality sharpening becomes easier.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #71 on: July 04, 2014, 10:50:51 am »

When I still believed in the existence of "free time", I was planning to scan BBC tech reports for goodies. The basis for this New Year resolution was this very article.
Logged

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #72 on: July 04, 2014, 10:56:33 am »

...you use an "HDR version" of ImageMagick which is not available as pre-compiled binaries for regular users. The extreme temporary gamma adjustments require floating point calculations for the image to survive.
Indeed. I should have put in big bold letters that users without access to an HDRI version of IM may not get acceptable results because you need the -gamma operation to be accurately invertible. This goes for sigmoidization too. (To make things even more messy, I believe that ImageMagick 7 still has fairly different sigmoidal-contrast code than the widely available ImageMagick 6. IM7's is better.)
This being said, it may work acceptably well when you don't care for 16-bit accuracy in the final result. I've not checked whether the round off error (and LUT) artifacts are visible. But I would not be surprised at all if they are with gamma 32, and would be disappointed but not shocked if they are at gamma 4.
« Last Edit: July 04, 2014, 11:23:30 am by NicolasRobidoux »
Logged

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #73 on: July 05, 2014, 04:33:29 am »

My current "short list of recommended ImageMagick image resizing methods": http://www.dpreview.com/forums/post/53970721
Logged

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #74 on: July 15, 2014, 03:38:13 am »

I am pretty sure that sigmoidization is now a dead prototype: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=25736&p=113272#p113272
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: Most favourable up-ressing percentage
« Reply #75 on: July 15, 2014, 10:27:22 am »

I am pretty sure that sigmoidization is now a dead prototype: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=25736&p=113272#p113272

Hi Nicolas,

Thanks for the progress update.

I'm also wondering if another approach could be easily implemented in ImageMagick. What most of the efforts sofar attempt to do is upsample and minimize artifacts (halo, ringing, blocking, some aliasing). The results look pretty useful. Most filters also attempt to improve the contrast compared to a simple bilinear interpolation (Triangle filter).

However, what about a version of upsampling that is not trying to increase sharpness when upsampling (maybe 'Gaussian'), and add some deconvolution to compensate for the upsampling losses. I understand that it is difficult to dynamically adjust the required (probably Gaussian) PSF radius with variable upsampling percentages, but that would not be too much of an issue if one uses fixed percentages in a batch/script file instead of from the command line console.

Here is an example for a 300% upsample (Windows batch file formatting, allows drag and drop):
convert %1 -filter Gaussian -distort Resize 300%% -define convolve:scale=^100%%,100 -morphology Convolve DoG:0,0,1.7 "%~dpn1_Gauss+HighPass.png"
The 100% part in the "-define convolve:scale=^100%%,100" parameter, allows to modify the 'amount' of High-pass sharpening. The 1.7 part of the "-morphology Convolve DoG:0,0,1.7" parameter allows to adjust the 'sigma' of the Gaussian High-pass.

This would have the benefit of allowing to control the upsampling artifacts through choice of resampling filter (e.g. Gaussian), and restore some sharpness by using a targeted approach (e.g. High-pass) which should not produce halos (or at least relatively controllable ones) if well dimensioned, or can be used to add a bit of halo to pre-compensate for later losses in our output medium (e.g. ink diffusion).

Of course a real iterative deconvolution method would be able to do an even better job than a simple single High-pass convolution sharpening.
Just some food for thought ...

Cheers,
Bart
« Last Edit: July 15, 2014, 11:10:30 am by BartvanderWolf »
Logged
== If you do what you did, you'll get what you got. ==

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #76 on: July 15, 2014, 12:31:50 pm »

...
Just some food for thought ...
That's why I'm here :)
Logged

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #77 on: July 15, 2014, 12:33:51 pm »

I don't have time to program or test this, but I would guess that a well chosen binomial would work better than a Gaussian.
Probably not a big difference, though.
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: Most favourable up-ressing percentage
« Reply #78 on: July 15, 2014, 12:44:56 pm »

I don't have time to program or test this, but I would guess that a well chosen binomial would work better than a Gaussian.

Nicolas, do you mean a Lagrange filter version? I can give it a look.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

NicolasRobidoux

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 280
Re: Most favourable up-ressing percentage
« Reply #79 on: July 15, 2014, 01:04:01 pm »

Nicolas, do you mean a Lagrange filter version? I can give it a look.
I mean this: http://www.imagemagick.org/discourse-server/viewtopic.php?t=22432#p93883
Note: If your idea works well, it will work well enough with Gaussians. What the binomial would do is ensure that your filter is C^0, which is pretty much a necessity when enlarging a lot.
Note 2: There is another direction I'm exploring. I am not sure I can do so in public, however. Need to check.
« Last Edit: July 15, 2014, 01:06:35 pm by NicolasRobidoux »
Logged
Pages: 1 2 3 [4] 5   Go Up