png file, color change ?? drawImage #156

Open
parkheeyoung opened this Issue Feb 28, 2012 · 0 comments

Projects

None yet

1 participant

@parkheeyoung

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

.....

After image

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

24bit, 72dpi -> canvas -> 32bit, 95dpi change??

drawImage bug???

Help me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment