ericdrowell / KineticJS

KineticJS is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://www.kineticjs.com
3.98k stars 752 forks source link

Image quality on upscale is poor #978

Open CSI68 opened 10 years ago

CSI68 commented 10 years ago

Hello,

When I insert a big image on my stage, I can correctly change the size of it, the resolution is good. But when I upscale the entire stage (x2 ou x3) the image is just 'zoom' from the thumbnail and not from the original image with good resolution.

Between 5.1.0 Kineticjs do it fine...

Any idea to correct this ?

Best regards, Clément

CSI68 commented 10 years ago

I ve found a part of answer... I use image.cache() for brightness parameter. So when I upscale the scene, the image keep the small image cache... I try this after upscale to recreate image cache : image.clearCache(); image.cache({ x:-1_image.getWidth()/2, y: -1_image.getHeight()/2, width: image.getWidth()_scale, height: image.getHeight()_scale }); image.drawHitFromCache(); image.filters([Kinetic.Filters.Brighten]);

But didn't work, the image is always small and resolution bad...