我正在使用织物js并删除我使用RemoveColor过滤器的白色背景。它的工作正常,如果图像尺寸像2500px一样大,那么图像的尺寸小于2000px。
Image less then 2000px remove white working correctly
Image greater than 2000px edge cut of
fabric.Image.fromURL('resized_245001682.png', function(oImg) {
var filter = new fabric.Image.filters.RemoveColor({
color:"#fff",
threshold: 40,
distance: 0.1
});
oImg.applyFilters();
canvas.add(oImg);
canvas.renderAll();
});
出现此问题是因为默认的textureSize是2048,使用
fabric.textureSize = 5000;