You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if I'm using things correctly, but I think I might have a bug in the way that the gaussian (as well as blur) filter works on transparent images.
Here is a test image pre-masked with text and then having the filter applied to the whole image:
Left side is actually transparent and will show through GitHub page color.
Steps to create:
Make a new 200x100 image
Set every pixel transparent white
Paint the right half fully opaque green
Use a fully opaque mask (default for new image)
Apply filter
I would expect that both texts would be blurred, but only the one with opacity is.
Am I using things wrong or is it a bug?
Code:
#!/usr/bin/env node
const{ Image }=require('image-js');asyncfunctiontest(){varimage=newImage(200,100);// set the whole image transparent whitefor(varx=0;x<image.width;x++){for(vary=0;y<image.height;y++){image.setPixelXY(x,y,[255,255,255,0]);}}// paint the right half opaque greenimage=image.paintPolygon([[image.width/2,0],[image.width-1,0],[image.width-1,image.height-1],[image.width/2,image.height-1]],{color: [0,255,0,255],filled: true});mask=newImage(200,100);consti=2;image=image.paintMasks([mask,mask],{labels: ['r = '+i,'r = '+i],labelsPosition: [[42,55],[140,55]],labelColor: 'black',labelFont: '12px Helvetica'});image=image.gaussianFilter({radius: i});image.save('output'+i+'.png');}test();
The text was updated successfully, but these errors were encountered:
I'm not sure if I'm using things correctly, but I think I might have a bug in the way that the gaussian (as well as blur) filter works on transparent images.
Here is a test image pre-masked with text and then having the filter applied to the whole image:
Left side is actually transparent and will show through GitHub page color.
Steps to create:
I would expect that both texts would be blurred, but only the one with opacity is.
Am I using things wrong or is it a bug?
Code:
The text was updated successfully, but these errors were encountered: