Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

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?".
Hyllian
Posts: 17
Joined: 2014-06-06T04:28:29-07:00
Authentication code: 6789

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by Hyllian »

NicolasRobidoux wrote:I persists in thinking that if you vary B and C (without, possibly, sticking to Keys cubics) you'll find a combination that compares.
The only thing that could make a comparable result reachable with 4x is that you extend your disc up to radius 2.5.
The problem with this is: the second function from BC-cubic is only defined between 1.0 and 2.0, so the weight will be zero even if I get samples outside r=2.0. Besides, the second function from BC-Splines assume weird values after x=2.0.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

Sergio:
I wish I could tell you what B,C combination would give you something that complies to the look that I guess you are after. However, this look appears to be fairly far from what I have been trying to achieve, and consequently it is likely to be far from Keys cubics.
I actually like the result of RobidouxSoft. Yes, it's soft. But it's "natural". And it shows a remarkably small amount of ringing given how sharp it is. (I believe that the ringing in the sky around the pole at the top right is in the original image.) I think that schemes that sit between RobidouxSoft and Robidoux on the Keys line, I'd like the results of and find them reasonably natural looking given their blurriness. (Even though the original image is not "natural" looking to start with: I know this image and it shows sharpening artifacts, which I suppose one can expect from much video material, so of course you can be after whatever look you want, and it may be more appropriate than what I like for your application.)
Nonetheless, I think that by sampling B,C space you'll come to something you like. Where in B,C space? Don't know right off the bat. Maybe along the line B+C=1 instead of B+2C=1 in the map of BC-splines http://www.imagemagick.org/Usage/filter/#mitchell ? Or something like B=.8 and C=.5 (or something along the line B+C/2=1)?
(Again, all of this is off the top of my head.)
Last edited by NicolasRobidoux on 2014-06-08T10:17:42-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

If any reader has any comment regarding the look of the RobidouxSoft result, I'd like to read it.
Also, if Sergio could post the result with EWA Robidoux, I'd be thankful.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

Hyllian wrote:
NicolasRobidoux wrote:I persists in thinking that if you vary B and C (without, possibly, sticking to Keys cubics) you'll find a combination that compares.
The only thing that could make a comparable result reachable with 4x is that you extend your disc up to radius 2.5.
The problem with this is: the second function from BC-cubic is only defined between 1.0 and 2.0, so the weight will be zero even if I get samples outside r=2.0. Besides, the second function from BC-Splines assume weird values after x=2.0.
I apologize: There was a typo.
I meant that the only thing that could make a comparable result UNreachable with BC-cubics would be that you use a disc that extends to radius 2.5, and this "can't be matched". Without "de-deblurring" you are limited to radius 2 with BC-splines, as you indicated.
Hyllian
Posts: 17
Joined: 2014-06-06T04:28:29-07:00
Authentication code: 6789

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by Hyllian »

NicolasRobidoux wrote:If any reader has any comment regarding the look of the RobidouxSoft result, I'd like to read it.
Also, if Sergio could post the result with EWA Robidoux, I'd be thankful.
Sure, this is using Robidoux params:

Image

How can I describe the quality I'm looking. Well, I want something very sharp, without ringing, without jaggies, without posterization and without blurring. :P

The nearest to this ideal image I've gotten so far are those provided by jinc2 with AR. I probably can't get anything close to that using the default BC-cubic functions. sO I think I'm stuck with Jinc2+AR for now, until I find new cubics.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

Side note:
It is my current opinion that the sharpest Keys cubic that's usable for general natural image EWA upsampling is the Robidoux one. IMO, it's actually a nudge too sharp. Consequently, I don't recommend EWA Mitchell, RobidouxSharp, and Catmull-Rom for upsampling. And I actually don't really recommend EWA Robidoux, even though I do like EWA with slightly softer BC-cubics (one of them being RobidouxSoft, but, without having tried it, I would bet that B=.5 and C=.25 is pretty "natural looking" without being unbearably soft).
For downsampling, it is another story: EWA Robidoux is just fine. Not as good as EWA Lanczos, LanczosSharp and QuadraticJinc among linear schemes, but fairly cheap, and without a second halo.
This being said, many people (including Sergio :) ) like way sharper results than I do, so...
P.S. Revised opinion: There are situations in which the sharpest ones are actually good choices.
Last edited by NicolasRobidoux on 2014-06-25T02:45:50-07:00, edited 4 times in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

As I mentioned before, I'm also not sure anymore that Keys cubics are best.
Hyllian
Posts: 17
Joined: 2014-06-06T04:28:29-07:00
Authentication code: 6789

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by Hyllian »

Anyways, Nicolas, thank you very much for the suggestions, they were very useful! I woudn't have realized how bland the textures were in my first batch of pictures if you hadn't pointed! It's very good to get other perspectives and broad your own.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by fmw42 »

NicolasRobidoux wrote:If any reader has any comment regarding the look of the RobidouxSoft result, I'd like to read it.
Also, if Sergio could post the result with EWA Robidoux, I'd be thankful.
Nicolas,

Sorry if I have missed this, but where have you detailed RobidouxSoft. I do not see it listed at http://www.imagemagick.org/Usage/filter/ or http://www.imagemagick.org/Usage/filter/nicolas/

Have all your named filters been added to IM?

Fred
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

fmw42 wrote:
NicolasRobidoux wrote:If any reader has any comment regarding the look of the RobidouxSoft result, I'd like to read it.
Also, if Sergio could post the result with EWA Robidoux, I'd be thankful.
Nicolas,

Sorry if I have missed this, but where have you detailed RobidouxSoft. I do not see it listed at http://www.imagemagick.org/Usage/filter/ or http://www.imagemagick.org/Usage/filter/nicolas/

Have all your named filters been added to IM?

Fred
viewtopic.php?f=22&t=19823&start=30#p109820
I've not gotten to programming those in yet. May take a while, even though it is a rather small job, at least if I'm lazy and use the same deblur for all number of lobes.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

Also note that http://www.imagemagick.org/Usage/filter/nicolas/ is slowly going stale: What's suggested there is not "wrong", just not quite my current best.
No time to update now.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

Interacting with Sergio Barbosa (Hyllian) made me realize something that I should have noticed way earlier: Many people are way more tolerant of posterization than I am, and are willing to trade a fair amount of it for reduced blur and haloing.
This explains some preferences that I just "did not get" before.
I think that I've gotten used to haloing now, so haloing that made my hair rise on end a few years ago does not phase me so much anymore.
On the other hand, I am more sensitive to "color separation/drift" (artifacts in the chromatic aberration family) than I used to be.
It appears that I need to become more aware of my own visual biases.
Last edited by NicolasRobidoux on 2014-06-09T04:38:04-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

Note: Warning about using the clown image for tests: The small version that was re-enlarged by Hyllian in this thread, and re-enlarged at http://www.general-cathexis.com/interpolation/, contains quite a bit of haloing. Unless you are planning to enlarge such images, be wary of conclusions drawn from re-enlarging this particular one.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

I'll have to revisit the "don't upsample through linear light" diktat. At least with samplers that have little or no haloing, this piece of advice is now quite suspect. With Nohalo-LBB for example (not available in IM), linear light (or, at least, XYZ: I've not checked linear RGB) is the clear winner.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Sigmoidized Ginseng (pronounced "Jinc-Sinc") resampling

Post by NicolasRobidoux »

I'm being asked questions about EWA LanczosSharp for video, so here are some quick off the top of my head links for people who are interested in resizing:

viewtopic.php?f=1&t=21703&start=90#p111986

You will find lots of useful stuff in these forums, and you can ask questions.

I don't think that there is an open source GPU implementation.

Also see the code for the DOWNSAMPLING components of https://git.gnome.org/browse/gegl/tree/ ... r-nohalo.c and https://git.gnome.org/browse/gegl/tree/ ... r-lohalo.c

http://www.gson.org/thesis/warping-thesis.pdf

http://www.imagemagick.org/Usage/filter

http://www.imagemagick.org/Usage/distorts/#distort_ewa

If you are only resizing, it's much simpler: You don't need to deal with ellipses.

I you don't want significant haloing you may do well using a Keys cubic instead (radius 2) instead of a (deblurred) 3-lobe jinc-windowed jinc. Cheaper too. The "alpha" parameter then adjusts the sharpness (between RobidouxSoft and RobidouxSharp is a good region).

On the other hand, with video there are color space issues that are not present otherwise, so sticking to a deblurred Jinc-windowed Jinc like Mathias Rauen may bring significant benefit.

If you are only resizing, keeping aspect ratio (and possibly cropping) means the ellipse is a disc, and if you change the aspect ratio it becomes an ellipse with axes aligned with the Cartesian axes. Much much easier.
Easier because you don't need to implicitly do a polar decomposition (related to SVD) of the transformation matrix: You just scale the axes.

Warning: Really off the top of my head.
Post Reply