Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
@alt1/ocr
Advanced tools
Readme
This library is used to read text in-game.
This library works slightly different from other OCR methods as it relies on pixel matching of the characters. This works particularly well with runescape as all characters are simply rendered as sprites. The disadvantage is that every font needs definition files to be read.
In order to read a piece of text you need to supply the font that the text is written with. This package includes several standard fonts (@alt1/ocr/fonts/
). To generate your own, use the @alt1/font-loader
package.
npm i @alt1/ocr -s
import * as OCR from "@alt1/ocr";
import * as A1lib from "@alt1/base";
//currently need webpack configured with @alt1/font-loader to do this
import font from "@alt1/font-loader!@alt1/ocr/fonts/aa_8px_mono.fontmeta.json";
//capture a 400x400 area of the screen starting at 100,100
var imgref = A1lib.capture(100,100,400,400);
//grab the raw pixels
var imagebuffer=imgref.toData();
var color=[255,255,255];//rgb => pure white
//read the text at position 100,100 of the imagebuffer. The given point must be somewhere _in the middle_ of the text.
var text=OCR.findReadLine(imagebuffer,font,[color],100,100);
console.log(text)//{text:"hello",debugArea:{x:80,y:95,w:30,h:10}}
FAQs
This library is used to read text in-game.
The npm package @alt1/ocr receives a total of 85 weekly downloads. As such, @alt1/ocr popularity was classified as not popular.
We found that @alt1/ocr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.