24 November 2005

Bitmap tracer

Yesterday Oldes released nice program, bitmap tracer. ( http://box.lebeda.ws/~hmm/rebol/projects/vectorize/latest/vectorize.r ). It's written in rebcode and the algorythm is his own, not a implementation. He's using it for converting bitmap fonts to vector ones for usage in his REBOL/Flash dialect. And because it's Oldes, the usage is somehow tricky :)

do http://box.lebeda.ws/~hmm/rebol/projects/vectorize/latest/vectorize.r

probe vectorize http://box.lebeda.ws/~hmm/rebol/projects/vectorize/latest/img41.gif

If you try that code you can see result is not very REBOLish, a block of numbers. It's the coordinates in [x y x y ...] format, because rebcode cannot handle pair!. Erhm, pardon, rebcode cannot handle pair! ??

>> a: rebcode [x][pick y x 1 print y]
>> a 1x1
1

Seems it can :) Oldes has separate function for conversion of his row of numbers to pair! so usage seems like that:

probe ctx-vectorize/to-pairs vectorize http://box.lebeda.ws/~hmm/rebol/projects/vectorize/latest/img41.gif

Yes, great. Unfortunately, the result is somehow scaled and shifted, so somebody should correct 'vectorize function to support pairs or correct 'to-pairs function not to shift and scale result.

But these are just minor problems, they're result of Oldes' coding style. The main thing is that it's now possible to natively convert bitmap images to vectors. And that's great!

64 comments:

Anonymous said...

M5QxiL write more, thanks.

Anonymous said...

Good job!

Anonymous said...

Wonderful blog.

Anonymous said...

Good job!

Anonymous said...

Thanks to author.

Anonymous said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

Anonymous said...

Please write anything else!

Anonymous said...

Magnific!

Anonymous said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

Anonymous said...

Hello all!

Anonymous said...

Magnific!

Anonymous said...

Please write anything else!

Anonymous said...

Wonderful blog.

Anonymous said...

What is a free gift ? Aren't all gifts free?

Anonymous said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

Anonymous said...

Lottery: A tax on people who are bad at math.

Anonymous said...

All generalizations are false, including this one.

Anonymous said...

Oops. My brain just hit a bad sector.

Anonymous said...

When there's a will, I want to be in it.

Anonymous said...

C++ should have been called B

Anonymous said...

Save the whales, collect the whole set

Anonymous said...

When there's a will, I want to be in it.

Anonymous said...

The gene pool could use a little chlorine.

Anonymous said...

Suicidal twin kills sister by mistake!

Anonymous said...

Please write anything else!

Anonymous said...

Change is inevitable, except from a vending machine.

Anonymous said...

A flashlight is a case for holding dead batteries.

Anonymous said...

Give me ambiguity or give me something else.

Anonymous said...

The gene pool could use a little chlorine.

Anonymous said...

Ever notice how fast Windows runs? Neither did I.

Anonymous said...

Clap on! , Clap off! clap@#&$NO CARRIER

Anonymous said...

Thanks to author.

Anonymous said...

Beam me aboard, Scotty..... Sure. Will a 2x10 do?

Anonymous said...

Suicidal twin kills sister by mistake!

Anonymous said...

Oops. My brain just hit a bad sector.

Anonymous said...

640K ought to be enough for anybody. - Bill Gates 81

Anonymous said...

All generalizations are false, including this one.

Anonymous said...

When there's a will, I want to be in it.

Anonymous said...

When there's a will, I want to be in it.

Anonymous said...

Give me ambiguity or give me something else.

Anonymous said...

What is a free gift ? Aren't all gifts free?

Anonymous said...

Oops. My brain just hit a bad sector.

Anonymous said...

Calvin, we will not have an anatomically correct snowman!

Anonymous said...

What is a free gift ? Aren't all gifts free?

Anonymous said...

Build a watch in 179 easy steps - by C. Forsberg.

Anonymous said...

The gene pool could use a little chlorine.

Anonymous said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

Anonymous said...

What is a free gift ? Aren't all gifts free?

Anonymous said...

Friends help you move. Real friends help you move bodies.

Anonymous said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

Anonymous said...

640K ought to be enough for anybody. - Bill Gates 81

Anonymous said...

I'm not a complete idiot, some parts are missing!

Anonymous said...

Lottery: A tax on people who are bad at math.

Anonymous said...

If ignorance is bliss, you must be orgasmic.

Anonymous said...

The gene pool could use a little chlorine.

Anonymous said...

Give me ambiguity or give me something else.

Anonymous said...

If ignorance is bliss, you must be orgasmic.

Anonymous said...

Friends help you move. Real friends help you move bodies

Anonymous said...

Wonderful blog.

Anonymous said...

I don't suffer from insanity. I enjoy every minute of it.

Anonymous said...

A lot of people mistake a short memory for a clear conscience.

Anonymous said...

The gene pool could use a little chlorine.

Anonymous said...

Thanks to author.

Anonymous said...

Give me ambiguity or give me something else.