Loss of color quality when saving canvas into an image in javascript -
i implementing cropping tool images (using jcrop library) gives possibility upload images, choose cropping area, , save image disk clicking in button.
all logic works, except image saved disk looses it's colors tone , and few details well.
cropped 1 on left, original on right
my javascript of canvas drowing following:
crop_canvas = document.createelement('canvas'); crop_canvas.width = width; crop_canvas.height = height; crop_2d = crop_canvas.getcontext('2d'); crop_2d.imagesmoothingenabled = false; crop_2d.drawimage(image_target, left, top, parseint(width), parseint(height), 0, 0, parseint(width), parseint(height)); this.href = crop_canvas.todataurl('image/png');
i'm missing ? see wrong ?
thanks!
Comments
Post a Comment