Improving sigmoidal image resampling (enlargement)

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?".
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Improving sigmoidal image resampling (enlargement)

Post by NicolasRobidoux »

Another result (EWA Lanczos through gamma 2.5) here: http://www.dpreview.com/forums/post/53939045

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

Re: Improving sigmoidal image resampling (enlargement)

Post by NicolasRobidoux »

I'm starting to think that the best way to improve sigmoidization is to replace by a blend of an enlargement through a gamma space and an enlargement through linear light.
In other words, the best way to improve sigmoidization >>for natural images<< is to use something else.

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

Re: Improving sigmoidal image resampling (enlargement)

Post by NicolasRobidoux »

Preliminary findings
I am pretty sure that sigmoidization is dead as a general purpose resampling method.
The simple version of what works better is to use mapping through a gamma space (with a matching pair of -gamma commands, like

Code: Select all

-gamma 3 -distort Resize 800% -gamma .33333333333333
) to reduce the most offensive of the halos, namely the dark ones, varying gamma until the light and dark halos are equally offensive :)
Converting whatever into linear light before passing things through "gamma resizing" is almost certainly a very good idea. For example

Code: Select all

-set colorspace sRGB -colorspace RGB -gamma 3 -distort Resize 800% -gamma .33333333333333 -colorspace sRGB
if both your input image and your output image are sRGB.
(So far, I have tested with XYZ instead of RGB using a different software program.)
Generally, gamma 1 leads to offensive dark halos with filters that have negative lobes. On the other hand, large gammas lead to exaggerated light halos and, possibly, to color artifacts, esp. if a non-HDRI version of ImageMagick is used.
-----
I have developed a more robust way of doing the above, which I am investigating as time permits.

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

Re: Improving sigmoidal image resampling (enlargement)

Post by NicolasRobidoux »


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

Re: Improving sigmoidal image resampling (enlargement)

Post by NicolasRobidoux »


Locked