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

Improve eraser handling #69

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Azeirah
Copy link
Contributor

@Azeirah Azeirah commented Apr 2, 2023

I made two improvements to the eraser.

  1. I made sure that the eraser will always draw with a white color.
  2. The eraser width now scales linearly with base_width rather than exponentially

I think the fix to always draw with a white color is correct.

The width scaling is still a bit off, but I think it's better to have a more constant scaling.

I have tested this with three notebooks, one is a notebook with hundreds of pages of written text, and the others are shown in the related issue request: #65

@Azeirah
Copy link
Contributor Author

Azeirah commented Apr 2, 2023

Just to make sure this code won't have major impacts on certain notebooks, I wanted to check whether I could influence the eraser size on my ReMarkable.

I took a notebook with a lot of black, so I can see the size of the eraser clearly.

  1. Move the physical eraser at the back of the pen from the top to the bottom of the page, gradually increasing pressure. The width of the eraser remained constant
  2. Move the eraser tool using the pen tip from the top to the bottom of the page, gradually increasing pressure. The width of the eraser remained constant

I think if we want to solve the eraser width very precisely, we could approach it the following way

  1. Find out how to reproduce the varying base_widths of the eraser on a real notebook.
    • in my .rm files I found values of [1, 2, 2.4] so far). With base_width I mean the w value that is read from the .rm file, corresponding to an eventual stroke_width after some calculations.
    • Does pressure influence this value?
      • For the pen eraser tool
      • For the physical eraser on the back
    • Does tilt influence this value?
      • For the pen eraser tool
      • For the physical eraser on the back
    • What values can we get?
  2. Create a notebook that is entirely black
  3. For all base_width values that we have found are possible, measure as exactly as possible the width of the eraser that ReMarkable renders on their device.
  4. Use those measurements to create a table that is as precise as possible.

Although, this approach might not work as long as other tools also have stroke-widths that do not correspond exactly with ReMarkable's internal output.

Alternatively, we could simplify the measuring steps by reading the actual framebuffer or possibly even by going through the binary using ghidra.


Anyway, that's for if we want to achieve perfection. For now "pretty good" is good enough :p

@Azeirah Azeirah changed the title Improve eraser handling Draft: Improve eraser handling Apr 2, 2023
@Azeirah Azeirah marked this pull request as draft April 2, 2023 21:45
@Azeirah Azeirah changed the title Draft: Improve eraser handling Improve eraser handling Apr 2, 2023
@Azeirah
Copy link
Contributor Author

Azeirah commented Apr 2, 2023

I'm having trouble finding good values for the eraser width. The linear scaling does not work quite as I want.

In one document, a larger linear parameter results is desired, in another this makes the eraser too large.

rmc Doesn't have a better approach either. It simply does base_width * 2.

@Azeirah
Copy link
Contributor Author

Azeirah commented Apr 2, 2023

Might be best to split this PR up into two individual PRs. One for the color issue, which I think is ready for merging, and another for the scaling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant