You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With two differences: first is that the r and b channels have been swapped, and second is the typo of 0.5126 for 0.2126 in the weight of the red channel. This should also be technically on linear RGB rather than sRGB (as you'll likely get from JS) but that's less of an issue.
The current code weights blue ~7x higher than it should. I don't know whether it's worth changing smartcrop.js results at this point to fix it, though.
The text was updated successfully, but these errors were encountered:
Thinking about this a little more, I think the result is that smartcrop.js prefers blue edges.. Which probably doesn't skew the results badly one way or another for most images.
Gave it a quick test, as you suspected, the results are mostly but not exactly.
I want to play with the smartcrop algorithm again anyways and actually derrive all of the magic fuzz factors in a more scientific way than guessing so I'll probably release the change together with that (when it happens).
The luminance calculation in smartcrop.js is currently:
But going back to the HDTV Rec. 709 (either https://en.wikipedia.org/wiki/Rec._709 or the original https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-6-201506-I!!PDF-E.pdf ), these coefficients should be:
With two differences: first is that the r and b channels have been swapped, and second is the typo of 0.5126 for 0.2126 in the weight of the red channel. This should also be technically on linear RGB rather than sRGB (as you'll likely get from JS) but that's less of an issue.
The current code weights blue ~7x higher than it should. I don't know whether it's worth changing smartcrop.js results at this point to fix it, though.
The text was updated successfully, but these errors were encountered: