Shop OBEX P1 Docs P2 Docs Learn Events
16 color .xpm image viewer from SD — Parallax Forums

16 color .xpm image viewer from SD

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2008-03-24 09:26 in Propeller 1
Having had my fill of text-based applications, I thought I'd turn my attention to something new..

Potatoview (named after Doug's high-color driver I borrowed for this..)

This viewer will display 16 color .XPM (X Pixmap) graphics. (GIMP will do these) at 160x96
(I discovered that I could get the character=color to stay consistent if I included a small
pixel bar using all colors are the top of the graphic before converting to .xpm.)

A few images are included in the zip, just change the filename in spin and recompile.
The images need to be copied to SD before running, as they will be read with fsrw.

As soon as I get my head around a more intelligent graphics format, I'll move to 64 color next. [noparse]:)[/noparse]

rename to .zip extension
OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Getting started with the Protoboard? - Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card? - PropDOS
A Living Propeller FAQ - The Propeller Wiki
(Got the Knowledge? Got a Moment? Add something today!)

Post Edited (Oldbitcollector) : 3/22/2008 2:05:15 AM GMT


Comments

  • RaymanRayman Posts: 14,162
    edited 2008-03-22 01:05
    That's very interesting! I wonder if these low resolution but 256-color modes are possible in VGA too...

    Actually, I guess it says 125 colors from 8-bits (for some reason I don't see).
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-03-22 01:41
    I am going to have to read more about the .XPM format, but it seems fairly easy to work with.

    I peeked at your code. I think porting this to work on the uOLED-96-PROP is an option, especially with the 8-bit per pixel routines I posted. Of course, the display size is only 96 pixels by 64 pixels.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-03-22 01:51
    The catch with .XPM is that the defined character=to=color definition is a bit random,
    (In otherwords an X might be red in one picture or blue in another)
    so you have to write an RGB-to-color table to properly read and set the colors.

    I discovered that if I placed a simple 16 color pixel line at the top of the graphics,
    then the .XPM character-to-color conversion would stay stable, as it seems assignments
    are first come-first serve. And the RGB table conversion was really tossing me under
    a table, so in the case, I just skip past it.

    If someone wants to play with this, or better yet improve on the idea... <grin>
    I'll attach the 16 color pixel line bar to this post.

    The images were cranked down the size, pixel bar placed, and saved as
    16-color bitmap in mspaint. Then I used windows-GIMP to convert them to .xpm.

    OBC

    my graphic is sooo small the forum thinks it's nothing!
    download the pixbar file and rename with .zip extension.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

    Post Edited (Oldbitcollector) : 3/22/2008 1:56:26 AM GMT


    191B
  • potatoheadpotatohead Posts: 10,260
    edited 2008-03-22 15:34
    Good stuff Oldbit!!

    No worries about having to name it potatoview. I put the code out there for people to futz with. Was just checking out color, that's all. Name it what you want to name it! Of course, potatoview might get you some, "what the hell?" downloads [noparse]:)[/noparse]

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

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-03-22 15:41
    Actually the "potatoview" name was kinda a joke, but I thought with everything
    else being called propTHIS and spinTHAT we were due for a change. <smirk>

    Actually when I do a version of this to run from PropDOS, I'll have to
    shorten it to spudview.... tongue.giftongue.giftongue.gif

    OBC

    Edit

    Anyone know how to create a 64 color bitmap? Paint only does 256 and 16

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

    Post Edited (Oldbitcollector) : 3/22/2008 3:51:54 PM GMT

  • potatoheadpotatohead Posts: 10,260
    edited 2008-03-22 16:10
    Try Lview. It's got lots of easy color reduction capabilities.

    The try-buy version runs for a while. Long enough to have a good play with your code. I bought one years ago and still run it regularly.

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

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-03-22 16:37
    @Doug: what is the rhyme and reason behind the color number and what is displayed?

    I suspect I'll have to sit down next and actually write a hex code converter.
    I'll start with 32 colors and go from there.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

  • potatoheadpotatohead Posts: 10,260
    edited 2008-03-22 19:37
    Can you get on IRC?

    Not sure which hex code and which color!

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

    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net

    Post Edited (potatohead) : 3/23/2008 2:20:41 AM GMT
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-03-24 09:26
    Spudview is born!

    This viewer is (unfinished) able to render color .ppm files without
    modification. (Gimp will create .ppm) Looks pretty good if you
    don't try to throw too many colors at it.

    File attached, copy the .ppm image files to your SD, and UNremark
    the proper line to view. (Several test images included.)

    The tables are a little laborious, if you see a shortcut, jump in. [noparse]:)[/noparse]

    OBC

    rename with .zip extension

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)


    60K
Sign In or Register to comment.