javascript - Canvas incorrectly antialiasing. Is there a way to force correct rendering? -
i having problem rendering canvas ctx.imagesmoothingenabled = true
when mixes colours makes them dark. colour should square root of mean of sum of squared input values. mean of sum of inputs.
pixels colours values represent square root of actual photons emitted on screen or captured via camera. antialiasing on machines have looked @ seem incorrectly , results in annoying dark artifacts around high contrast parts of image.
the code showing correct , incorrect way average rgb value 2 2 pixel area.
// 2 2 pixel down 1 pixel // correct way var r = math.sqrt( (r11*r11 + r12*r12 + r21*r21 + r22*r22) / 4); var g = math.sqrt( (g11*g11 + g12*g12 + g21*g21 + g22*g22) / 4); var b = math.sqrt( (b11*b11 + b12*b12 + b21*b21 + b22*b22) / 4); // how canvas render ?? (i assuming) var r = (r11 + r12 + r21 + r22) / 4; var g = (g11 + g12 + g21 + g22) / 4; var b = (b11 + b12 + b21 + b22) / 4;
what know is. there way around this, via browser setting (any browser desperate), hardware device setting, or other technique?
currently forced render canvas image in software excruciatingly slow in javascript when rendering out .webm , .gif formats. surely others must have encountered , solved problem makes using canvas "2d" pointless.
i have image shows problem not sure how upload here display.
Comments
Post a Comment