Shop OBEX P1 Docs P2 Docs Learn Events
Displaying an image (120x80) — Parallax Forums

Displaying an image (120x80)

CalvCalv Posts: 2
edited 2007-08-02 20:28 in Propeller 1
Hello,

I would like to be able to display simple images on a VGA monitor (image size 120x80, 255 colors) using the propeller.
Concerning the memory this should be possible: 120*80*1=9600 bytes.

When using 16x16, 4 colored tiles the maximum "resolution" could be about 64*48 (by changing the library file vga_512x384_bitmap_demo.spin).

I read the posts of Chip Gracey, however these·drivers are limited to a color palette of 64 colors which doen't fit my purpose.

Can somebody give me a hint in what direction to go? I understand that Chip used 2 cogs. Could somebody explain to me in more detail how this works because this could be the way to go.

Thanks! icon13.gif

Calv

Post Edited (Calv) : 8/1/2007 9:40:30 PM GMT

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2007-08-01 22:02
    Calv,

    Take a look at my paranormal imager... basically, you send the image back through the terminal... and then use an imaging utility to view it.
    I set it up using ImageJ. The advantage is that you can create any size of image with any bit depth.

    http://forums.parallax.com/forums/default.aspx?f=25&m=203693&g=203938#m203938

    Rich
  • potatoheadpotatohead Posts: 10,260
    edited 2007-08-02 00:44
    At that resolution, you could run a higher pixel clock, then dither to easily reach your 255 color limit. Say you ran the pixel clock at the 320x200 mode, or perhaps 512x384? The patterns possible, within a 120x80 pixel sized macro-pixel would blend nicely, IMHO.

       o   ooo  o0o  *0*  000  ***   
      o o  ooo  0o0  0*0  000  ***   
       o   ooo  o0o  *0*  000  *** 
    
    



    Do you need more colors or intensities or both?

    Colors mix easier this way, but both can be done.

    The real tough part is setting up the lookup tables for the dot patterns... might be more trouble than it's worth. Maybe somebody has a pointer to some thing easy to implement.

    At moderate resolutions, you can drive each pixel directly to be any of the 64 standard colors. This is done by using the WAITVID instruction somewhat backward from how it's normally used. Instead of passing a WAITVID pixels and colors, thus invoking the 2 or 4 color limit, you pass it only colors, and always output 4 pixels, thus allowing for any particular pixel to be any color.

    There is some information about this here: it's for NTSC, but the idea is the same for VGA.

    http://propeller.wikispaces.com/Palette+Mode

    I'm pretty sure you can get at least a 320x200 pixel display, with each pixel being any of 64 colors and no tiles, with one COG. (probably double that pixel clock wise)

    The thing that really takes up COG time, is not pushing pixels to the monitor. Those go really well. It's mashing bits to make the most of the RAM, or overlay sprites, and do other things. Going from HUB to COG, plus shifting, masking, etc... gets you into a multi-cog scenario fairly easily. If the driver were kept simple, maybe there would be enough room in the COG for a simple mixing scheme, done with a lookup table.

    Is it important to use the Parallax reference video circuit? If not, take a look at the work Baggars did. He has his own video output circuit, with very high color depth. A small variation on this, might work really well, if you build your own output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!

    Post Edited (potatohead) : 8/2/2007 1:05:39 AM GMT
  • CalvCalv Posts: 2
    edited 2007-08-02 20:28
    Thanks! I'll give the special WAITVID mode a try.

    Calv.
Sign In or Register to comment.