Summary: improved EWA LanczosSharp with sigmoidization

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".

Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-18T19:32:10+00:00

In http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=21660, I discuss the use of a "sigmoidal" colourspace to reduce halo and blur when upsampling with the classical Lanczos (tensor Sinc-windowed Sinc) 3-lobe filter. In this post, I briefly discuss using sigmoidization with EWA (Elliptical Weighted Averaging) LanczosSharp, that is, Jinc-windowed Jinc 3-lobe with filter support scaled so that the first zero crossing is pretty much where it should be when the image is a 1D impulse (pixel-wide white column on a black background).
EWA LanczosSharp is a really good low pass filter. Not as sharp as orthogonal Lanczos, but "cleaner".
Unlike what I did with orthogonal Lanczos, I will use a possibly slightly "unsafe" contrast value, namely the one that gives an enlarged black square that stays within 2.3 JND of black, when the square is on a white background. With LanczosSharp, the corresponding contrast value is about 12.09375. (Maybe this value is slightly on the high side? This method is too new for me to know for sure.)
Code:
Code: Select all
magick INPUT.IMG -colorspace RGB +sigmoidal-contrast 12.09375 -filter Lanczossharp -distort Resize 400% -sigmoidal-contrast 12.09375 -colorspace sRGB OUTPUT.IMG

First, I'll repeat the four comparative tests based on http://www.wisdom.weizmann.ac.il/~vision/SingleImageSR.html. (Note that I have absolutely nothing to do with this site or the methods tested therein.) I'll also add an enlargement of text which I put together myself (with GIMP).
Last edited by NicolasRobidoux on 2012-08-24T05:23:25+00:00, edited 15 times in total.
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-18T19:35:51+00:00

First, the baby (a 4x enlargement):
Image
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-18T20:38:09+00:00

Second, the man (a 4x enlargement):
Image
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-18T20:41:25+00:00

The mother (a 4x enlargement):
Image
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-18T20:43:55+00:00

Fourth, the chip (a 4x enlargement):
Image
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-18T20:48:40+00:00

As with tensor Lanczos, adding more lobes (and correspondingly adjusting the (de)blur) can be used to add a bit of sharpness and decrease jaggies, at the expense of more haloing.
Instead of showing that, let me add an example of what this general purpose scheme does with text. Let's enlarge the following image 4x:
Image
Image
Pretty good for a general purpose scheme.
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-20T13:10:56+00:00

Let me add one more test image from http://www.wisdom.weizmann.ac.il/~vision/SingleImageSR.html. (I admit that choosing this particular one is cheating: Some subject matter is friendly to soft focus, and EWA LanczosSharp, sigmoidized or not, is definitely on the soft side.)
Image
This being said, download the above enlargement, and also download the SR one from the Weizmann Institute. Now, zoom in on the face and eyes with a "neutral" enlarger (like nip2). Or even Control-+ on your web browser a bunch of times.
Conclusion: Maybe there is a reason why the Weizmann site only shows enlargements by factors of 3 and 4.
(No need to tell me I'm biased. I know.)
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-21T17:50:59+00:00

With EWA Lanczossharp, the "safer" contrast (that enlarges an image which is black on the left and white on the right to the same within 2.3 JND) is about 9.8323.
Last edited by NicolasRobidoux on 2012-08-30T12:54:17+00:00, edited 1 time in total.
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-08-23T06:27:54+00:00

Here is an 3x enlargement (of the firemen test image from the Weinzmann site) with the "safer" contrast:
Image
Using the higher value of the contrast raises acutance more. It looks good, but I like "safe".
P.S. Note that the original (that is being enlarged) was sharpened. Some of the halos seen in this enlargement are actually in the original.
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-09-08T11:19:34+00:00

Here are versions of the enlargements shown at http://www.imagemagick.org/discourse-server/viewtopic.php?f=22&t=21804 done with sigmoidized EWA LanczosSharp with the "safer" contrast value:
Image
Image
Image
Image
Image
Image
Image
Image
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-09-08T12:31:56+00:00

With the "less safe" contrast value this time:
Image
Image
Image
Image
Image
Image
Image
Image
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark

Re: Summary: improved EWA LanczosSharp with sigmoidization

Postby NicolasRobidoux » 2012-09-08T12:37:49+00:00

With sigmoidization, it's really hard to tell that the above are results of applying a 3-lobe filter.
NicolasRobidoux
 
Posts: 1935
Joined: 2010-08-28T11:16:00+00:00
Location: Copenhagen, Denmark


Return to Users

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Google Adsense [Bot] and 11 guests