How to convert any displaying file to bitmap...

Discussion in 'Programmer's Corner' started by RRITESH KAKKAR, Feb 23, 2013.

  1. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,

    I am working on LED display ( scrolling simple one not RGB based) and need your guidance for converting any clip art like file to bit map represetation on pixel by any mean....

    thanks
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Download Irfanview It is an image display/resize/filter program that can also do screen captures and other stuff. FREEWARE. It can convert formats to any other format, including to .BMP

    Once you have your bitmap, download LCD Assitant Which will take a .BMP image as input, and output a C code hex block describing the image, either column by column, or row by row. It needs to know which, otherwise the results look like static. Same for Endian-ness (MSB or LSB first), dependent on processor architecture and your code, basically.

    Those two links were enough to get several 12 to 15 year olds moving pictures from their phones to LCD Displays, you should be able to figure it out by trail and some error. :)
     
  3. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,
    I have loaded file and giving only zeroes....
    Code ( (Unknown Language)):
    1.  
    2. //------------------------------------------------------------------------------
    3. // File generated by LCD Assistant
    4. // http://en.radzio.dxp.pl/bitmap_converter/
    5. //------------------------------------------------------------------------------
    6.  
    7. const unsigned char a [] = {
    8. 0x28, 0x00, 0x28, 0x00,
    9. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    10. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    11. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    12. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    13. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    14. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    15. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    16. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    17. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    18. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    19. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    20. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    21. };
     
    • a.jpeg
      a.jpeg
      File size:
      4.3 KB
      Views:
      67
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    You have a display that uses 100x100 pixels per letter??

    Open Ifranview, create new canvas, height same as number of LEDs. Then show paint dialog, and in Black and White only, enter a letter.

    Code ( (Unknown Language)):
    1.  
    2. //------------------------------------------------------------------------------
    3. // File generated by LCD Assistant
    4. // http://en.radzio.dxp.pl/bitmap_converter/
    5. //------------------------------------------------------------------------------
    6.  
    7. const unsigned char a [] = {
    8. 0x08, 0x14, 0x14, 0x22, 0x22, 0x3E, 0x41, 0x41, 0x00, 0x00,
    9. };
    10.  
    11.  
    8x8 pixel Letter A in a 10x10 "box", in Anonymous Pro (The most awesome console font in existence!). Horizontal aligned, no image size, little endian (8 bit processors)
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
  6. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89

    here it is change canvas image there is no new canvas..
    any way, i have opened image -> change canvas -> 8x8 pixel ...
    i don't understand why to open paint in it and write i want to convert jpeg into hex code..
    please clear my doubt
     
  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Why do you want to use JPEG? It is a lossy compression, so the result is text with "fuzzy" (grey) edges, which are neither white nor black.

    If you draw the raw text in an image with Irfanview in 1 bit color mode, the result is on and off pixels, which is the only thing black and white LCDs can display.

    The way the converter works, is if the pixel is not black, it is not set, so the bits are all zeros.

    If you already have the file in .JPG format, change pallete to 1 bit mode, and that is what can be displayed on an LCD. Then pick "resize/resample" to reduce it to the size you need for LED or LCD display, then save it as .BMP, which the LCDAssistant will then convert into a nice C-code friendly array for use in your program.
     
  8. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,669
    804
    You can also resize an existing image to the desired resolution.
     
  9. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    Hi,
    Actually i want to display some clip art on led display 10x32 so, i want t convert in array..
    Then how to have 1bit mode??
     
  10. Ian Rogers

    Member

    Dec 12, 2012
    158
    29
  11. RRITESH KAKKAR

    Thread Starter Senior Member

    Jun 29, 2010
    2,831
    89
    hi....
     
Loading...