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 306663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:29:15+00:00 2026-05-12T07:29:15+00:00

i am trying to extract outline path from given bitmap, i create a fast

  • 0

i am trying to extract outline path from given bitmap, i create a fast algorithm (for me) on as3 and that is:

    //@v source bitmap's vector data
    //@x x to starting extraction
    //@y y to stating extraction
    //@w extraction width
    //@h extraction height
    //@mw source bitmap width
    //@mh source bitmap height
    private function extractRects(v:Vector.<uint>, x:int, y:int, 
                                w:int, h:int, mw:int, mh:int):Array
    {
        var ary:Array = [], yy:int=y, vStart:int, _xx:int, xx:int;
        var lcold:int = 0, lc:int;
        //first line to last line
        while(yy < h)
        {
            //first index of current vector
            vStart = yy * mw + x;
            xx = x;
            lc = 0;
            //first vector to last on current scan
            while(xx < w)
            {
                /*
                    if current vector value (color) is 
                    empty (transparent) then
                    check next
                */
                while(xx < w && !v[vStart])
                {
                    vStart++;
                    xx++;
                }
                //it is not empty so copy first index
                _xx = xx;
                //check till value is not empty
                while(xx < w && v[vStart])
                {
                    xx++;
                    vStart++;
                }
                //create rectangle
                var rr:Rectangle = new Rectangle(_xx, yy, (xx-_xx), 1);
                //if previous line has the same rectangle index
                if(lc < lcold)
                {
                    var oldrr:Rectangle = ary[ary.length - lcold];
                    //if previous neighbour rect on top
                    //has same horizontal position then
                    //resize its height
                    if(oldrr.left == rr.left && oldrr.width == rr.width)
                        oldrr.height++;
                    else
                        ary.push(rr);
                }
                else
                    ary.push(rr);   
                lc++;
                xx++;
            }
            lcold = lc;
            yy++;
        }
        return ary;
    }

With the above method, I extract the region and create shape by drawing rectangles..
Drawing rectangles does not seem to be a good solution because of non-smooth view.

In order to have a smoother view, I must use lines or curves but, using point neighbouring technique is really big headache for me right now.

Could anyone please recommend me any better solution?

as3, c++, c#, vb.net, vb6, delphi, java or similar languages will be fine for answers.

EDIT FOR CLEARIFICATION

I am trying to extract non-transparent pixels’ x, y coordinates from a bitmap to draw on different path data. (32 bit ARGB) (creating shape)

For drawing, I could use lineTo, curveTo, moveTo operations.

moveTo(x, y)
lineTo(x, y)
curveTo(cx, cy, ax, ay)

in my code, I thought that I could extract the rectangles of current non-transparent blocks and I could use the same rectangles with moveTo and lineTo operations on further graphic methods

The problem is that this method gives non-smooth look on edges which is neither horizontal nor vertical.

So, the solution is creating a point map on edges, detecting the point neighborhood, using the lineTo operation (because it generates antialiased lines) between neighbour points on rows, or calculating the points placement on nearest circle area and using curveTo method..

Question Could anyone recommend me some algorithms or methods for extracting job?

Thanks in advance

  • 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-12T07:29:16+00:00Added an answer on May 12, 2026 at 7:29 am

    What you’re looking for is bitmap/raster image to vector software. To get a good quality result, there are many non-trivial steps that must be performed. There is an open source project called Potrace which does this – click here for a technical description of how it works. If you’d like to try its algorithm in an GUI program, you can use Inkscape with its Trace Bitmap function.

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

Sidebar

Ask A Question

Stats

  • Questions 275k
  • Answers 275k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would second the shout for RedGate SQL Dependency Tracker.… May 13, 2026 at 2:30 pm
  • Editorial Team
    Editorial Team added an answer You should really look at the content-type and content of… May 13, 2026 at 2:30 pm
  • Editorial Team
    Editorial Team added an answer --no-pager to Git will tell it to not use a… May 13, 2026 at 2:30 pm

Related Questions

I am trying to extract a gif image embedded as a resource within my
I am trying to extract a certain part of a column that is between
I am trying to extract a table of values from an excel (2003) spreadsheet
I am trying to extract the schema of an .mdb database, so that I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.