Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

PouyaCatnip

ACII characters for greyscale-type rendering

This topic is 5131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve got to do an image blurring algo for some work, and since its supposed to run on *nix (''cos it used the MPI library) any actual graphics are out of the question (tight time limit as well, so don''t bother pointing me at stuff like SDL ) So I thought rather than just numbers I''d output an ASCII rendering, trying to get various intensities corresponding to difference character codes. Actually translating values to codes is a snap, but I''ve no idea how I can come up with a good range of char codes. It doesn''t really have to have much range (say, somewhere between 8 and 16 intensities) and considering theres plenty of ASCII 3d renderers already existing I was wondering if anyone knew of some example type stuff or suggestions? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
1) Make a little program to spit out each available ASCII char into a bitmap.
2) Make a little program to analyze the darkness of each cell (containing one character) in this bitmap.
3) Sort from darkest to brightest (ASCII 32, space, better be the brightest if black text on white BG), and then pick several cells as the best-looking representation of their darkness level.

Share this post


Link to post
Share on other sites
If you want to get fancier than that, draw each ASCII character to a small (say 8x5) array of pixels. Then, for each part of the image of that size, choose the character whose array of pixels is closest to that part of the image (that is, the sum of the absolute differences between the intensity of the character bitmap and the real bitmap at each pixel is minimal).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!