增加色彩對比度飽和度

使用增加影象的飽和度

ctx.globalCompositeOperation = 'saturation';

可以使用填充疊加中的阿爾法設定或飽和度來控制效果量

// Render the image
ctx.globalCompositeOperation='source-atop';
ctx.drawImage(image, 0, 0);

// set the composite operation
ctx.globalCompositeOperation ='saturation';
ctx.fillStyle = "red";
ctx.globalAlpha = alpha;  // alpha 0 = no effect 1 = full effect
ctx.fillRect(0, 0, image.width, image.height);

StackOverflow 文件