News for hackers. Stuff that matters.
Re:Show HN: Simple image resizing/optimization service by hoahluke on Monday February 06, 2017 @10:40AM (#13580406)
I didn't think this would come up so quickly! This can actually be fixed with an undocumented option 'gamma'[1]

I didn't include it in the website, admittedly because I didn't fully understand it, and I wanted to keep the service as simple as possible.

Would it make sense for this to be the default?

[1] https://i.scaley.io/png-gamma-256x128/i.imgur.com/X9vKa2s.pn...

Re:Show HN: Simple image resizing/optimization service by leni536 on Monday February 06, 2017 @10:53AM (#13580549)
Nice! I think it should be the default. Some software might treats as a compromise between correctness and cost (doing the rescaling in linear space is usually more costly). In my view it should be correctness first.

The ImageWorsener's website as an excellent reading material on image resizing and other transformations. ImageWorsener is a "correctness first" image resizing software.

http://entropymine.com/imageworsener/

Re:Show HN: Simple image resizing/optimization service by zzzcpan on Monday February 06, 2017 @11:03AM (#13580671)
"Correctness" is not very useful in image processing, it's all about perception and performance.
Re:Show HN: Simple image resizing/optimization service by XaspR8d on Monday February 06, 2017 @11:56AM (#13581361)
Well "correct" in the case of linear vs non-linear luminance is pretty much exactly about perception (or at the very least, working to prevent perception differences further down the pipeline), even if it is a somewhat minor effect.

"The Importance of Being Linear"[1] which just came up on HN a few days ago, discusses some issues with non-linearity, specifically in the context of 3D rendering.

[1] - http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html

Re:Show HN: Simple image resizing/optimization service by mark-r on Monday February 06, 2017 @11:47AM (#13581236)
There are lots of specific examples where incorrectness leads to perceptually significant problems. I'd agree that you don't normally notice it in the wild, which is why so much software has gotten away with it for so long.

It is possible to optimize the linearization steps so that they don't detract too much from the performance, especially if you're using one of the better (i.e. slower) interpolation methods.

Re:Show HN: Simple image resizing/optimization service by arcameron on Tuesday February 07, 2017 @01:44AM (#13587607)
This page[1] documents some effects of gamma-incorrect resizing. Specifically, check out Figure 12.

[1] http://blog.johnnovak.net/2016/09/21/what-every-coder-should...

Re:Show HN: Simple image resizing/optimization service by hoahluke on Monday February 06, 2017 @11:01AM (#13580642)
Thanks for your detailed feedback on this, I appreciate it!
Re:Show HN: Simple image resizing/optimization service by Arnt on Monday February 06, 2017 @10:54AM (#13580563)
Averaging two RGB numbers isn't at all similar to how the human eye averages two colours.

The colour experts have a variety of ways to do much better, almost any of them will give you much better results. Pick one and be done. Your undocumented -gamma- option is fine.

If you want the best option you should be prepared to invest a lot of time and attention, in return for which you'll get a result that's perhaps a little better than your -gamma- and a lot better than plain RGB averaging.