Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7041367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:02:07+00:00 2026-05-28T02:02:07+00:00

I grab subtitle from movie screenshot. An example It will grab Hey, why don’t

  • 0

I grab subtitle from movie screenshot.
An example
enter image description here

It will grab

Hey, why don’t we all just relax, huh?

It has no relation with subtitle. It is screenshot. Since it is a subtitle we know the font type size etc if this will make it easier to grab.

I know most of you will say PHP OCR library but since the background is always different, it looks like it won’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:02:08+00:00Added an answer on May 28, 2026 at 2:02 am

    The background being different shouldn’t be a problem, you can just use an image library to remove anything that isn’t the text colour.

    Here’s a quick example that gives a decent idea of what I mean, it replaces any colour lower than #f5f5f5 with #000000,

    <?php
    $im = imagecreatefromjpeg("img.jpg");
    
    for ($x = imagesx($im); $x--;) 
    {
        for ($y = imagesy($im); $y--;) 
        {
            $rgb = imagecolorat($im, $x, $y);
    
            if ((($rgb >> 16) & 0xFF) <= 245 
                && (($rgb >> 8) & 0xFF) <= 245 
                && ($rgb & 0xFF) <= 245) 
            {
                $black = imagecolorallocate($im, 0, 0, 0);
                imagesetpixel($im, $x, $y, $black);
            }
        }
    }
    
    header("Content-Type: image/jpeg");
    imagejpeg($im);
    

    Here’s how the result looks:

    You can probably chop most of the top part off since you know the subtitles will be at the bottom. Then just run it through an OCR library.

    For PHP there’s PhpOCR, although this has to be taught first with example letters.

    It’s probably better to use an external OCR library or command line tool and call it from PHP. For external tools, there’s tesseract and ocropus (I believe ocropus is sponsored by Google too).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to grab a screenshot from a NSView, draw a string on top
I'm trying to grab all the links and their content from a text, but
Im trying to first grab all the links from a page, when get the
I'm trying to grab all NA phone numbers from a CSV file. The numbers
I want to grab the Name and PhoneNumber vals from the Contacts Content Provider
I'm looking to grab cookie values for the same domain within a Flash movie.
I am attempting to grab frames and preview the video from a Bodelin Proscope
I need to grab several items from other page right now my jquerycalls looks
How can I grab just part of an xml column, and return it as
I want to grab all the inputs inside a form, in order to submit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.