• Welcome to Dark Bit Factory & Gravity.
 

convert frame buffer to ascii

Started by ninogenio, February 25, 2008

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ninogenio

right i figure im going to have to do as all the tmdc boffins do and do framebuffer to ascii window convertion.

so iv ported a few routines from the tfx lib to freebasic to make it happen, more specifically from the tmdc5inv demo. i dont know if iv ported them correctly but it works rather pleasingly.

ive included an exe source and test image. the source is a bit all over the place as im still messing.

up next is block color convertions

have fun.
Challenge Trophies Won:

rain_storm

Its that old familiar sunset but done old school lol this will really benefit from color conversion

Challenge Trophies Won:

ninogenio

yeah probably not the best image to show of the conversion but if changed with a close up of a face it's amazing how good the conversion is.
Challenge Trophies Won:

Shockwave

This would probably work better with images that are moving I think Nino.
I did recognise it as a sunset but only after I stared at it for some seconds.
Shockwave ^ Codigos
Challenge Trophies Won:

ninogenio

#4
like i said not the best picture to try it out on.

if you guys want just drop one of your own pics in, it's quite easy.

i was posting the source incase anyone might want anything from it and seeing as it is rendered to the double buffered window it would be quite easy to replace it with a moving demo effect.
Challenge Trophies Won:

ninogenio

right ive now got block color going and ironed out a few bugs in the normal ascii conversion which makes it look better now.

use right arrow key to flick back and forth between the two test images and the up arrow key to go between block color and normal ascii.

guess i better do something with it now.
Challenge Trophies Won:

rain_storm

Those colours are miles better I knew this had a lot of potential keep up the good work nino

Challenge Trophies Won:

ninogenio

cheers mate,

with these conversion routines porting full rgb demo effects should be much simpler with a more polished look. one thing to note for anyone going to use this is that the frame buffer is in bgr format other than that you still have to be carefull as to wich colors you use as some look better than others.
Challenge Trophies Won:

Shockwave

Now you're on the right track. This looks miles better :)
Shockwave ^ Codigos
Challenge Trophies Won:

benny!

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

ninogenio

cheers guys i really hope i can do something nice with it now.
Challenge Trophies Won:

frea

it crashed when i tried to quit.
I could hardly see the sunset, but i am an ignorant in terms of ascii art :).
Nananan.

ninogenio

yeah it will crash if you try to quit using the cross, it should quit with esc.

this will be of better use in moving demos ive already done some test's and im very pleased. the image loader thing was just a little test to see if it was working. but yeah you'r right the sunset look's a bit pants :p
Challenge Trophies Won:

Shockwave

Are you going to enter something into the next tdmc then? ;)
Shockwave ^ Codigos
Challenge Trophies Won:

ninogenio

tbh shockwave im not all that intrested in entering any comps other than the ones we run here,

i dont program to get my self noticed i do it purely for the learning, i always wanted to know how ascii was done so here i am figuaring it out. once i feel i have a grasp on it i will probably move to something else :) thats what ive always done.

i will be entering something ascii into the new dbf comp though ;)
Challenge Trophies Won:

taj

This is interesting stuff.

It occurred to me, is it legal in ascii competitions to create an opengl (or D3D) window, behind the ascii window, render to the opengl window, capture the framebuffer and then convert using routines like ninos and render that to the ascii window? Or is that a big no-no for ascii compos?

Taj
Challenge Trophies Won:

Shockwave

I believe that is legal and widely done Taj.
Shockwave ^ Codigos
Challenge Trophies Won:

ninogenio

yep perfectly aceptable,

ive even seen animation sequences done in a gif like format of 3d objects and then converted. if your intrested in seing your idea come to fruition taj. i can port a c example you have and run it through the converter for you if you like.
Challenge Trophies Won:

taj

Oh bloody hell that would be brilliant! Yes please. I'd love to try out this stuff "for free". I had a look at your code and it already is quite small - I guess with some work it might even be possible to do an ascii 4k.

Taj
Challenge Trophies Won:

ninogenio

#19
well yeah this could be brought down by a mile in size even in freebasic.

if the 4k was going to be of block colors only then the massive look up table could be done away with for a start, as well as over half the conversion code.

if your going to post a gl example for me to convert there is a couple of things id like to ask.

please keep the colors relativly simple and make the gl capture buffer 160 in x and 100 pixels in y.

other than that anything is possible really we may have to tweek the gl colors a bit to get them looking nice. but thats no problem.
Challenge Trophies Won: