Monday 15 July 2013

html5 - createjs bitmap image rotation makes image jagged in chrome -



html5 - createjs bitmap image rotation makes image jagged in chrome -

when seek rotate bitmap image createjs (not resize, rotate) bitmap image gets jagged in chrome. in firefox fine.

here code:

var backcard = new createjs.bitmap(assetsloader.getresult("back")); backcard.rotation = 24; stage.addchild(backcard); stage.update();

any ideas on how prepare ?

i don't know if want prevent or enable antialiasing on chrome, since me chrome gets rotated bitmaps antialiased , firefox don't, i'll talk both things...

enable antialiasing

there's no way of doing natively, can create workaround if want forcefulness antialiasing: adding blur filter in little amounts rotated images. maintain in mind blur expensive filter should avoid using, in case utilize it, you'll need cache bitmap after applying filter cut down cpu usage.

backcard.filters = [new createjs.blurfilter(2, 2, 1);]; // 2 blur radius, 1 blur quality. more quality means more expensive blur. var bounds = backcard.getbounds(); backcard.cache(bounds.x, bounds.y, bounds.width, bounds.height);

prevent antialiasing

i think there's no way of doing yet too, can utilize next version of easeljs allows define if objects antialiased stage, because of webgl. note if webgl isn't supported on user's browser easeljs fallback html5 canvas, still have antialiasing.

html5 google-chrome antialiasing easeljs createjs

No comments:

Post a Comment