Open inkxe-vasanth opened 6 years ago
This works better:
Caman.Filter.register('opacity', function(adjust) {
adjust = Math.floor(255 * (adjust / 100));
var inputData = this.pixelData, length = inputData.length;
// Adjust alpha channel (every 4th value):
for (var i = 3; i < length; i += 4) {
inputData[i] = inputData[i] == 0 ? 0 : adjust;
}
});
We need opacity for the image -
I have added this code to camenjs, it's working for me fine. Review the code add it if feel useful.
Code