Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I save only the drawing as an overlay? #844

Closed
liamslo opened this issue Feb 21, 2023 · 1 comment
Closed

How can I save only the drawing as an overlay? #844

liamslo opened this issue Feb 21, 2023 · 1 comment
Labels

Comments

@liamslo
Copy link

liamslo commented Feb 21, 2023

Summary
I would like to draw on an image, then remove the image so that I have an overlay against a transparent background. I have tried a few different methods to accomplish this, but have run into the following issues:

  • 'Objects' seem to only refer to the shapes (triangle, circle, rect). It does not appear that there is functionality to save a free or line drawing, then place it back onto the screen - is this correct?
  • As a workaround, my thought was to make the base image all white by increasing the brightness, and then add a Remove White or Color Filter to only leave behind the (red in my case) drawing. The brightness works, but I cannot find any information on how to add the color filter or remove white from the API. I have tried a few different variations of:
    getInstance().applyFilter('ColorFilter', {'Threshold': 100}).then((res: any) => { console.log(res) })
    but have not had any success. I have tried the same for Remove White, but am not sure what the types I should be using are.

Is there any solution to this issue? To reiterate, I would like to draw on top of an image, remove that image, then download just the drawing. Kind of like tracing.

Thank you.

Version
3.15.2

@liamslo
Copy link
Author

liamslo commented Feb 21, 2023

For anyone that is having the same issue/trying to do the same thing, this was my work-around:

getInstance().applyFilter('Brightness', {'brightness': 100}).then((res: any) => { getInstance().applyFilter('removeColor', { color: '#FFFFFF' }) console.log(res) })

That will remove the background image, while keeping the drawing in tact. I don't know how good of a workaround it is, but hopefully it helps someone in the same boat.

@liamslo liamslo closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant