LearnBoost/node-canvas — Issue #156: png file, color change ?? drawImage
Author: parkheeyoung
Created: 2012-02-28 07:36:44+00:00
State: open

var Canvas = require('canvas')
, Image = Canvas.Image
, fs = require('fs');

var img = new Image;

img.onload = function(){
var w = img.width
, h = img.height
, canvas = new Canvas(w, h)
, ctx = canvas.getContext('2d');

ctx.drawImage(img, 0, 0);

canvas .toBuffer(function(err, buf){
fs.writeFile('test.png', buf, function(){
});
});
};

img.src = 'default.png';

png file, color change ??

(Canvas(width , height) == image.width, image.height) : The same size

original image
http://s1-01.twitpicproxy.com/photos/full/526864039.png?key=21746

.....

After image
http://s1-05.twitpicproxy.com/photos/full/526863462.png?key=21642

(Canvas(width+? or height+?) > image.width, image.height) : normal
ctx.globalAlpha = '0.99' : normal
ctx.globalAlpha = '1' : color change

drawImage bug???

Help me...