Open mlopezdetrinidad opened 3 years ago
I don't know why, I didn't write the function so I'm not that familiar with it. Can you provide an example demonstrating the issue and I can take a look at it.
Hi,
Sorry for my late answer, I am doing the following:
` final RenderRepaintBoundary boundary = _coloring.boundaryKey.currentContext.findRenderObject() as RenderRepaintBoundary; final ui.Image image = await boundary.toImage(); final ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png); final img.Image currentImage = img.decodeImage( byteData.buffer.asUint8List(), ); final interpolation = currentImage.width / widthScreen; final dx = (localPosition.dx.floor() interpolation).floor(); final dy = (localPosition.dy.floor() interpolation).floor();
var pixelColor = currentImage.getPixel(
dx,
dy,
);
if (pixelColor == 4278190080) {
return;
}
Uint8List imageMask = img.maskFlood(
currentImage,
dx,
dy,
threshold: 100.99,
compareAlpha: true,
fillValue: 1,
);
Path pathBucket = potraceMask(
imageMask,
currentImage.width,
currentImage.height,
opttolerance: 0.0,
);`
But I am getting the following result:
if you see some angles of the image are not filling like in the tail of the unicorn.
But I don't what could be the issue.
Thank you.
Regards,
Can you give me the original image?
I am loading SVG string on CANVAS and then getting the repaint boundary of the widget that contains the canvas, I don't know if the SVG string works for you?
Then just from looking at it, I would guess the anti-aliasing of the SVG rendering is keeping the flood-fill from getting into those corners. Maybe play with the tolerance values?
I will play with the tolerance values, there could be the issue.
thanks a lot.
Hi,
I am trying to implement a bucket functionality on a coloring app that I am developing, but when I have used the mask flood functionality some corners of the image are not covered.
do you have any idea why is it happening?
I will appreciate your help.
Regards,