Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal,... gamma?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
Your sigmoidal-contrast first value 0.45 is so small as to be hardly doing anything, if I am not mistaken. It is nearly a linear function with slope almost unity, thus an no-op situation. What do you get if you remove the -sigmoidal-contrast on both sides? Is it at all visually different?
What is the "default" method?
Can you post the original size building image?
What is the "default" method?
Can you post the original size building image?
Last edited by fmw42 on 2012-09-23T20:10:51-07:00, edited 1 time in total.
-
- Posts: 56
- Joined: 2011-04-23T22:21:52-07:00
- Authentication code: 8675308
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
Here's take 2.fmw42 wrote:Your sigmoidal-contrast first value 0.45 is so small as to be hardly doing anything, if I am not mistaken. It is nearly a linear function with slope almost zero, thus an no-op situation. What do you get if you remove the -sigmoidal-contrast on both sides? Is it at all visually different?
What is the "default" method?
Can you post the original size building image?
The default method is a -resize without calling a -filter.convert xc: -bordercolor black -border 1x1 -colorspace RGB -sigmoidal-contrast 8x50% -define filter:kaiser-beta=4 -define filter:window=kaiser -filter sinc -distort resize 10000% -sigmoidal-contrast 8x50% -colorspace sRGB -sampling-factor 1x1 -quality 100% -strip 3x3-bamscaler2.jpg
Original building image: https://dl.dropbox.com/u/106615031/dsp/ ... 871921.jpg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
A sigmoidal contrast value of 8 is more in range with what Nicolas Robidoux has been using.
Are you trying to use the same filter for both enlarging and reducing?
Are you trying to use the same filter for both enlarging and reducing?
-
- Posts: 56
- Joined: 2011-04-23T22:21:52-07:00
- Authentication code: 8675308
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
Yes I am.fmw42 wrote:A sigmoidal contrast value of 8 is more in range with what Nicolas Robidoux has been using.
Are you trying to use the same filter for both enlarging and reducing?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
values below 1.0 are usless in sigmoidal-contrast. You may as well not use it at all.fmw42 wrote:Your sigmoidal-contrast first value 0.45 is so small as to be hardly doing anything, if I am not mistaken. It is nearly a linear function with slope almost zero, thus an no-op situation. What do you get if you remove the -sigmoidal-contrast on both sides? Is it at all visually different?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
To illustrate what's going on, I'm going to add some small comparisons to "The Recommendations".
First pass:
Comments?
First pass:
Comments?
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
With filters that are not blurry, contrast = 8 is close to the upper end of the "do no harm" range. When enlarging images that have the character of CG or text, or images which don't have extreme pixel values or are greyscale, or blurry images, higher values may work well, esp. with less sharp filters. But lots of images do not fit one of these types.fmw42 wrote:A sigmoidal contrast value of 8 is more in range with what Nicolas Robidoux has been using.
Maybe sigmoidization is OK with such images when downsampling, but it is generally not safe when downsampling. It's actually slightly evil. (So is sRGB.)
So, I am pretty sure that no sigmoidized scheme should make the "one single scheme for everything" short list.
Because linear light rules downsampling.
So if one single scheme is going to be used for enlarging and reducing, it has to be a linear light scheme. (Does not need to be linear RGB: XYZ works just fine.)
P.S. It's going to be linear light, unless something new is discovered, of course. But at this point, I think that it is unlikely that sigmoidization be worthwhile when downsampling, unless the image has some rather specific characteristics.
Last edited by NicolasRobidoux on 2012-09-28T05:33:12-07:00, edited 4 times in total.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
"Do no harm" is rather stringent a requirement.
With "more good than harm most of the time", the upper range of the contrast is about 13, slightly more for blurry filters like Quadratic and Spline.
With "more good than harm most of the time", the upper range of the contrast is about 13, slightly more for blurry filters like Quadratic and Spline.
-
- Posts: 56
- Joined: 2011-04-23T22:21:52-07:00
- Authentication code: 8675308
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
Perhaps I was too excited to develop my own filter and my naivety got the best of me. I should read more before I pursue this further.
I appreciate all the information you guys have given me.
I appreciate all the information you guys have given me.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
Can you try the above tables again but using light gray for the line?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
These images would not encourage people to use linear RGB, because sRGB is pretty good with dark halos. sRGB is worse than sigmoidized and linear RGB with light halos.
Also, thin dark features on a light background are more common than the converse.
But this set makes sigmoidization look pretty good IMHO.
Last edited by NicolasRobidoux on 2012-09-27T18:46:55-07:00, edited 3 times in total.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
If I took sRGB as defining "safe", I'd use a higher contrast.
But sRGB color bleeds a bit too much for my taste. You can even see it in the simplest situation:#007FFF is (R,G,B)=(0,127,255).
Going down from white, it first becomes greenish (turquoise), then reddish (I'm not too good with English color names), and finally goes to the right color.
P.S. This is a bad example: Through linear RGB, it does not look "obviously right" either. The green shift is less pronounced, however.
But sRGB color bleeds a bit too much for my taste. You can even see it in the simplest situation:
Code: Select all
magick -size 2x1 xc:white -fill '#007FFF' -draw 'point 1,0' small.png
magick small.png -filter Triangle -resize 1200x128\! big.png
Going down from white, it first becomes greenish (turquoise), then reddish (I'm not too good with English color names), and finally goes to the right color.
P.S. This is a bad example: Through linear RGB, it does not look "obviously right" either. The green shift is less pronounced, however.
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
This is exactly the type of image for which more sigmoidization works well:
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
@Bryant:
It was interesting watching you "go".
It was interesting watching you "go".
-
- Posts: 1944
- Joined: 2010-08-28T11:16:00-07:00
- Authentication code: 8675308
- Location: Montreal, Canada
Re: Enlarge with sRGB, RGB, LAB, LUV, XYZ, sigmoidal...?
I'm taking out EWA Lanczos2Sharp and adding Cosine-windowed Sinc 3-lobe (a.k.a. -filter Cosine), which is then the sharpest scheme in the collection. Works well with slightly blurry images.