Image TO ACSII converter..

This is a discussion on Image TO ACSII converter.. within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Well these days i am seeing a lot of ASCII graphics of images.. I am planing to build a progam ...

  1. #1
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    Image TO ACSII converter..

    Well these days i am seeing a lot of ASCII graphics of images.. I am planing to build a progam which reads a BMP file and converts it into ASCII graphics.. I thought of doing something like this.. Based on the shade.. like black grey, red etc.. replace it by a given Char... But that will not be effective.. Any ideas..

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Yeah, I've seen those funny converter, Although i have my
    doubts if they are really chars. If i understand right it reads
    the bmp for all it's pixels and converting them to char, Do this
    chars have a single color each? Or do they just have a color
    skin over them? If they all had a single color you'de need a VERY
    big char field to represent the bmp or skip ALOT of pixels.

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Look at the font you are using for your ascii equivalent, in particular, the cell size of the character, (assuming fixed width - much easier). For the sake of argument, assume a cell size of 7 x 9 pixels per character. Okay, get the first seven by nine pixels from your bit map, data reduce that to black and white, then do a compare between that random 7 x 9 field and the first character in your font, award it a goodness of fit score, then the second character and so on, when you have cpmpared all characters, place the character with the best score in the first cell, then do the second cell. That is how I would start at least.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    Look at aalib. They have a text-graphics driver out which looks like what you're talking about.

  5. #5
    booyakasha
    Join Date
    Nov 2002
    Posts
    208
    How bout make a program that turns a bmp into html code.

    like use tables and colors for each pixel.

    of course the code will be much larger ( in byte size ) then just the bmp image, but it may be useful anyway for things like forums or signatures which allow html code but dont allow images.

    or another option is to make the same program that takes in a text file as well and draws the image in the text by varying the color of each char. I've seen this done in magazine ads and it looks really cool.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 05:17 AM
  2. Replies: 1
    Last Post: 05-27-2009, 01:46 PM
  3. Simple Image Processing
    By ejohns85 in forum C++ Programming
    Replies: 4
    Last Post: 03-19-2009, 01:10 PM
  4. Replies: 4
    Last Post: 03-02-2003, 09:12 AM
  5. How to change a mouse cursor in console mode
    By GaPe in forum Windows Programming
    Replies: 10
    Last Post: 07-03-2002, 08:42 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21