Note assist is a Userscript designed to make translating easier and faster by automatically resizing or creating the notes for you.
This userscript changes basic note editing, so it's highly recommended to at least read the "Main changes", the more you know, the easier it is to use :).
Main changes
Automatic resize to text:
When you make a note by dragging, it will automatically look for text inside the note you created, and resize itself.
The success rate is high, but not 100%, see "Tips & indepth details" for more info.
If you hold shift while releasing the mouse button, the note will not resize. There is a setting to make the script only resize notes while shift is pressed.
Ghost notes:
A quick way to get rid of notes you don't need, all unsaved notes (red striped background) can be deleted with a right-click.
Additional features
These features are found in the noteAssist menu, which pops up when you press the 'Add note' link or hotkey for the first time.
Generate all notes:
As it says, this buttons (attempts to) generate notes for all the text on the image.
Text color (override): 'Generate all notes' will detect the color of the text in the image and bold the text 'black' or 'white' to show what it selected, if incorrect, the radiobuttons can be used to override it.
Note, on large images (2500*2500 & up), this function can take some time & memory.
Text decoration functions:
A set of buttons is available to apply styles like 'bold', 'larger font', 'font color', etc.
An Eyedropper function is also activated when pressing the (font)'color' or 'Background-color' button. Drag the image to select a color.
A zoomed image will be show in the Note Assist menu. You can click it to select a specific color as well.
User settings:
A custom menu to edit the script settings without having to go in the actual code itself -> 'settings' link in the noteAssist menu.
(Note for people that prefer editing the code: once settings are saved, it will ignore the defaults from the code)
Performance details
Javascript isn't great at text detection, so there are some limitations.
Calculation speed: Generate-all takes 0.5~2 seconds on an average sample comic. (freezing your browser in the meanwhile)
On exceptionally large images, if the code takes more than 20 seconds to run, it will pause and ask if it should continue. This allows for canceling if it takes too long.
Memory Usage: Aka "RAM". Depends on image dimensions, the script may silently break if you don't have enough free ram. Some numbers: a 1k*1k image takes up to 8Mb ram -- 2k*2k = 30Mb ram -- 4k*4k = 125Mb ram.
Known issues
Bugs:
- For the text decoration functions, upon clicking outside of the textarea, chrome and firefox no longer highlight any selected text (clicking outside the textarea does not deselect). -browser bug-
Text detection issues:
- texts with more than 2 paragraphs might not be detected as a single text
- Words that have 0 space between them, flow into eachother, or are connected by a line. -cannot fix-
- Text on a transparent background -won't fix, too rare-
- Light colored text on a light background / same for dark -cannot fix-
- Shading by dot pattern instead of gradient messes up detection, and slows the script drastically -trying to fix-
Found a new bug or interested in coding? Check the Github page
Tips & details:
- Auto resize code - It's better to make your note a bit too big instead of too small, anything touching the border of the note is instantly seen as not a letter.
- Letter recognition is impossible for handwritten Japanese, especially as a userscript.
- Text decoration functions - pressing 'bold' again while having "Text" selected will remove the "" tags again. This only works for the outer tags, not for any nested tags. Similarly, applying color -> fontsize will merge those into the same <span> tag. applying color -> bold -> fontsize will generate 2 <span> tags (bad).
To-do / planned features
- Automatic detection of square textboxes
Changelog:
2015-07-10 - v1.1:
- New button: "save all non-ghost notes" to make it easier to reposition a lot of notes.
- Notes resized by the script now are properly marked as "unsaved"
2015-05-15 - v1.0:
- New feature: Ctrl-click* an existing note to resize it (per type-kun's idea)
- Most of the logic & code re-written so people can actually read what is happening.
- Accuracy in detecting text remains about the same, I've pretty much hit a dead end trying to improve it.
- speed increase on everything!
- memory usage remains the same
- moved script objects to it's own namespace, improves cross-browser support & maintainability.
- much less likely to break when danbooru updates
2013-08-21 - v0.12:
- Updated to follow danbooru changes.
v0.11:
- Fix typo.
v0.10:
- Updated to follow danbooru changes.
2013-05-28 - v0.9:
- Added settings menu
2013-05-22 - v0.8:
- Moved eyedropper preview to below the buttons
- Added preview text to the eyedropper function
- Fixed rare bug where note could be 1-2px out of the image
- Added 'x' button to close the Note Assist window
- Changed "instantNote" setting to default "true"
2013-05-12 - v0.6:
- added 'instantNote' setting (default:false)
- generate-all now attempts to avoid text already covered by notes.
- Added text decoration buttons. (includes eyedropper/colorpicker function)
2013-05-09 - v0.4/v0.5
- Fixed wrong scaling when "Fit images to window" is enabled
2013-05-09 - v0.3
- Decreased memory usage by at least 66% (thanks Type-kun).
- Increased script speed by 2 to 4 times.
- Fixed chrome "back" bug.
- Fixed wrong dimensions bug after pressing "view original".
- Added info button linking back to this thread.
2013-05-07 - v0.2
- Increased script speed by up to 10 times.
2013-05-06 - v0.1
- First release, only has core function.
Updated