GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ollydev/SimpleOCR: Simba plugin to recognize text in Old School RuneScape.

This repository was archived by the owner on Oct 22, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

42 Commits
42 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
images
images
 
 
tester
tester
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
SimpleOCR.lpi
SimpleOCR.lpi
 
 
SimpleOCR.lpr
SimpleOCR.lpr
 
 
simbaplugin.inc
simbaplugin.inc
 
 
simpleocr.engine.pas
simpleocr.engine.pas
 
 
simpleocr.filters.pas
simpleocr.filters.pas
 
 
simpleocr.inc
simpleocr.inc
 
 
simpleocr.types.pas
simpleocr.types.pas
 
 

Repository files navigation

SimpleOCR

SimpleOCR is a Simba plugin for reading text in Old School RuneScape originally developed by @slackydev.

The algorithm is very much designed for OSRS (blocky text with no anti-aliasing). Every pixel of the glyph must match for for a character to be recognized.

The actual character recognition is quite similar to using Simba's FindBitmap for every character in the fontset.


Exported Methods

procedure TFontSet.Load(FileName: String; Space: Integer = 4);

function TSimpleOCR.Recognize(Area: TBox; Filter: TOCRFilter; Font: TFontSet): String;
function TSimpleOCR.RecognizeStatic(Area: TBox; Filter: TOCRFilter; Font: TFontSet; MaxWalk: Integer = 20): String;
function TSimpleOCR.RecognizeLines(Area: TBox; Filter: TOCRFilter; Font: TFontSet; out TextBounds: TBoxArray): TStringArray; overload;
function TSimpleOCR.RecognizeLines(Area: TBox; Filter: TOCRFilter; Font: TFontSet): TStringArray; overload;
function TSimpleOCR.RecognizeNumber(Area: TBox; Filter: TOCRFilter; Font: TFontSet): Int64;

function TSimpleOCR.LocateText(Area: TBox; Text: String; constref Font: TFontSet; Filter: TOCRFilter; out Bounds: TBox): Single; overload;
function TSimpleOCR.LocateText(Area: TBox; Text: String; constref Font: TFontSet; Filter: TOCRFilter; MinMatch: Single): Boolean; overload;

function TSimpleOCR.TextToMatrix(Text: String; constref Font: TFontSet): TIntegerMatrix;
function TSimpleOCR.TextToTPA(Text: String; constref Font: TFontSet): TPointArray; 

Filters

  • AnyColor Filter

    The first pixel (highlighted in red) of the character being checked is the color used, all other of the character must fall within Tolerance of that.

    If the fontset has a shadow each RGB value of a possible shadow point must be below MaxShadowValue.

    function TOCRAnyColorFilter.Create(Tolerance: Integer; MaxShadowValue: Integer): TOCRAnyColorFilter; static;

    Example

    This filter is generally used for uptext reading.


  • Color filter

    Basic color finding.

    function TOCRColorFilter.Create(Colors, Tolerances: TIntegerArray): TOCRColorFilter; static;
    function TOCRColorFilter.Create(Colors: TIntegerArray): TOCRColorFilter; static; overload;

    Example:

    TOCRColorFilter.Create([$0000FF]); // Find color red

    Example

    Example with tolerance:

    TOCRColorFilter.Create([$FFFFFF], [100]); // Find color white with 100 tolerance

    Example


  • Invert Color Filter

    Basic color finding but inverted.

    function TOCRInvertColorFilter.Create(Colors, Tolerances: TIntegerArray): TOCRInvertColorFilter; static; overload;
    function TOCRInvertColorFilter.Create(Colors: TIntegerArray): TOCRInvertColorFilter; static; overload;

    Example:

    TOCRInvertColorFilter.Create([3358536, 0], [3, 10]); // Everything but brown and black (text shadow)

    Example


  • Threshold Filter

    If a pixel brightness value is greater than a threshold amount, it is assigned white, else it is assigned black.

    function TOCRThresholdFilter.Create(Amount: Integer; Invert: Boolean = False): TOCRThresholdFilter; static;

    Example:

    TOCRThresholdFilter.Create(10); // Orange and red are brighter than the brown background

    Example


  • Shadow Filter

    First shadows are found using average R,G,B value. Shadow = (R+G+B) div 3 < MaxShadowValue

    Next shadow pixels are offset by -1,-1. The most common color from the offset pixels is used for the search color.

    function TOCRShadowFilter.Create(MaxShadowValue: Integer = 25; Tolerance: Integer = 5): TOCRShadowFilter; static; 

    Example:

    TOCRShadowFilter.Create();

    Example


Locate Text

The LocateText function does not OCR! An "image" of the desired text is generated with TextToMatrix/TextToTPA and searched for. Again quite similar to Simba's FindBitmap.

  • Works well with TOCRAnyColorFilter. Although this is slower.
  • Will not work if the spacing between characters is dynamic.

About

Simba plugin to recognize text in Old School RuneScape.

Topics

ocroldschool-runescapeosrssimbasimba-plugin

Resources

Readme
Activity

Stars

6 stars

Watchers

2 watching

Forks

9 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.