Shop OBEX P1 Docs P2 Docs Learn Events
Picture code — Parallax Forums

Picture code

AImanAIman Posts: 531
edited 2006-10-18 17:56 in General Discussion
Does anyone know who to access the code of a picture? I have some stuff on my computer and I want to look at the code for the pictures but can't figure out how to get inside the code.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-13 20:58
    There are a whole variety of picture formats including .JPG, .BMP, .TIF, .PNG, .GIF and they're all completely different. Some of them are standard like JPG and PNG. You'll just have to Google the ones you're interested in to try to find a definition of the file format.
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-10-13 23:09
    You can find information on 'a few' file formats over on http://www.wotsit.org/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • BeanBean Posts: 8,129
    edited 2006-10-14 01:45
    When I want to get pictures into a microcontroller (for an LCD or whatever), I find that the old .BMP format is the easiest to decode.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    Don't mistake experience for intelligence. And vis-vera.
    ·
  • AImanAIman Posts: 531
    edited 2006-10-17 02:54
    Bean said...
    When I want to get pictures into a microcontroller (for an LCD or whatever), I find that the old .BMP format is the easiest to decode.
    Thanks for the tip. Can I simply save a few pictures as .BMP in Xp or do I need to do something else to save them?

    How do you view the code? I haven't been able to figure that out. I have some simple experiments I want to do with pictures and colors but haven't been able to acces the code in anything.

    Any help with this would be most appreciated.
    ·
  • BeanBean Posts: 8,129
    edited 2006-10-17 11:49
    I'm not sure what you mean by "view the code" ???

    YOU have to write the code to read the picture. And BMP is probably the easiest format to do that.

    I used DOS based Turbo Pascal to write my code. It's pretty straight forward.

    I just save the pictures as 24-Bit with a certain X and Y size. Then you can just "skip" the header information and there is the pixel data.

    What format do you need to get the pixel data into ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    Don't mistake experience for intelligence. And vis-vera.
    ·
  • AImanAIman Posts: 531
    edited 2006-10-18 02:02
    What I want to do is take a picture of something - say a 2x4 - on a white background and then take the same 2x4 and put it on the lawn or lean it against the car and take another picture.

    Then by accessing the code of the picture with the white 2x4 I want to see if I can locate the 2x4 -· by reading the code - in the second picture.
  • Tom WalkerTom Walker Posts: 509
    edited 2006-10-18 13:37
    Well, first, using "code" to describe a "picture" can be very confusing. Pictures are typically not represented by any type of code (leave me alone, purists <g>). The short explanation is that pictures are nothing more than data which represents the color at a certain point in the picture...there are many ways to represent the color, either from a fixed pallette, as an absolute value, or as a comparison to a previous color. There is a glorious amount of information on this topic to be found (and it is interesting, as well).

    To address what you would like to do, this type of task is usually handled by image analysis techniques using color analysis, edge detection and the like. There is also quite a bit of information about these topics available and it can rapidly run into PhD level cognations. In any case, these functions typically require a fair amount of memory and LOTS of speed.

    A lot of this falls under the headings of "image processing" and "recognition" and "visual analysis". All fun topics, but not for the faint of heart.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
  • AImanAIman Posts: 531
    edited 2006-10-18 15:18
    I guess I get to learn a new topic then...

    Wait a minute, how does the CMU manage to follow colors? It gets programed. Is it the same sort of thing?
  • WarrlokWarrlok Posts: 77
    edited 2006-10-18 15:19
    hold ur shift key and right click and open in notepad or word pad,,and then u can veiw the code.
    looks like arabic.
  • kelvin jameskelvin james Posts: 531
    edited 2006-10-18 17:56
    If you want to experiment with your idea, get yourself a hex editor, preferably with a file compare like Cygnus ( shareware ). You can open and view hex code from pictures, and do a compare to find the difference in the code. What the info really means is another issue.
    It also has an export to C and asm.

    kelvin
Sign In or Register to comment.