Shop OBEX P1 Docs P2 Docs Learn Events
SPUDVIEW 1.1 / hi-color .PPM image viewer / 4xfaster — Parallax Forums

SPUDVIEW 1.1 / hi-color .PPM image viewer / 4xfaster

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2008-06-06 09:21 in Propeller 1
SPUDVIEW 1.1b (Originally called "potatoview", but was shorted for PropDOS 8.3 convention.)

The viewer will load .PPM image files, (Gimp for Windows will convert to this standard)
Max image size is 160x96 -- I've fine tuned my RGB conversion tables to a reasonable level.
(Still looking for a couple minor color issues [noparse];)[/noparse]

This will convert most RGB colors down to Doug's 128 HI-COLOR.
Images look pretty decent if you don't throw too many colors at it. [noparse]:)[/noparse]
(Compare the "thunder.ppm" to the original to see the improvement.)

--> Sorry, this version is hardcoded for demoboard/protoboard/spinstudio users.

Instructions: Copy the .ppm images to your SD card, adjust the SD settings
in spudview.spin to match your own. Load the program and type the filename.ppm

OBC
rename extension to .zip

Updated: Images load 4x faster

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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/26/2008 2:57:52 AM GMT


Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-03-26 02:57
    File updated in top post..

    Fixed most RGB conversion issues.
    (created a couple minor issues with others.)

    Images now load about 4x faster.


    Feel free to grind on the conversion tables and post if you get better results.

    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!)

  • RaymanRayman Posts: 14,233
    edited 2008-03-26 12:31
    Any screenshots? I didn't know about this "Hi-color" mode for TV. Driver says 125 colors, but I suppose that's a typo...
    See any easy way to get that pallete into something like Photoshop to better prepare images? I.e., can you backward map those colors into equivalent RGB values?
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-03-26 15:26
    I've been working on a visual comparison to 64 colors that may help.

    In each hue, there are about 3 colors that are too dark to be useful,
    so what Doug said about 83 colors seems to be accurate.

    I'm shooting for a solid 64 color conversion at this point.
    I'd estimate I've achieved around 40+ correct colors so far.

    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!)

  • vampyrevampyre Posts: 146
    edited 2008-06-03 08:22
    Ok. So I come up with this great idea, and to make sure i'm not re-inventing the wheel i do a forum search , and well... you guys beat me to it again. Which is great in a way cause i dont have to do anything but.. i'm starting to feel like a OBC WannaBE smilewinkgrin.gif

    This image viewer is great stuff. I'm modifying it so that it saves the generated image to the SD card, so that a seperate viewer app can view the converted images without converting them each time. (plus since the images are 8 bits instead of true color, they're smaller). Images are now loading in less than half a second.. which means with a little brute force i might be able to generate 3 or 4 FPS video playback. color is still a real pain though. My next step is to build a DOS commandline app (for windows or linux/wine) that takes a .bmp and converts it directly to a prop-friendly format. but before i do that i have a couple of questions i was hoping someone could help me out with.

    I'm afraid i dont understand prop video or color too well. I know my tv can show more colors than i'm getting. Is it the 3 bit DAC thats the problem? would a bigger DAC be possible/useful or would it be too slow/take too much memory? is there a schematic somewhere for a better NTSC generation system? Or should i be happy that i get color at all and move on with life?

    Jeff, are u still working on this project by any chance? Have you thought about a way to streamline the process of converting images to prop-compatible-color for non cartoon images ?

    I'd really like to be able to put photos on my SD and view them with my prop, thats the ultimate goal. but of course, photos of , well anything, come out looking really painful. lots of wrong colors and pixels.

    is it possible to create a more natural color palette? one less saturated, more naturals and neutrals? The only color modification i've done is with the standard TV graphics driver, and i wasn't very successful at getting anything but ugly.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-06-03 16:46
    By All means... GO FOR IT!

    I did spudview experimenting with the driver that Doug wrote, as it looked like great code,
    but it didn't look like anyone was playing with it. [noparse]:)[/noparse]

    I've never really been extremely happy with the method I'm using to determine the colors
    from the PPM file, so if you've got some ideas for improvement, grab and run with it!

    I'm a big believer in spreading the fun around.
    Multiple input in a project always results in a better project!

    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
    Need a part? Got spare electronics? - The Electronics Exchange
  • BaggersBaggers Posts: 3,019
    edited 2008-06-03 18:04
    Hi Vampyre, OBC [noparse];)[/noparse]

    As you may be aware vampyre ( I know OBC is very aware of my tinkerings with props video ability ) I have pretty much taken prop video to the max.

    OBC, if you want, I could do a assembly version of it, to speed it up 10 fold. unless you wanted to do it vampyre.

    anyway, vampyre, the problem with the 3bit DAC is that due to the way the hardware does the colour burst etc. it's limited to the 3 pins, thus adding more pins won't help, as it's a hardware limitation, you could use RGB SCART, if you have a tv that has a SCART connection [noparse];)[/noparse] but then you're also limiting your app to non-us users. so as for colour range, you're pretty much stuck with what we have, unless you go to an external chip, like the AD724 etc. but that's another story [noparse];)[/noparse]

    So with this limited colour choice you will get as you put it "really painful" colour conversions.

    as for video, you can VERY easily get 15fps with audio and at a push with smaller res, get 30fps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • vampyrevampyre Posts: 146
    edited 2008-06-03 19:37
    thanks for the quick replies guys and explaining things a bit. So i guess then my best bet is to fine tune Jeffs color conversion process which is do-able i think. Baggers, i've played a lot with your code and its really helped me understand things a little better.

    I'm actually ok with a slow conversion process, i prefer accuracy to speed, because i'll only be converting the images once.

    when i say 3 to 4 fps of video, i mean to say pre-recorded movies on an SD card. You're not saying that I can do 15 fps of pre-recorded video do you, cause, that would be awesome.. I think my bottleneck there is the SD card interface.

    I think i might be able to squeeze some sound into the video , but at this resolution (160x96) there wont be any double buffering for video.
  • BaggersBaggers Posts: 3,019
    edited 2008-06-03 21:49
    Hi vampyre, glad you're enjoying playing with my code [noparse];)[/noparse]
    As for video, look at our propGFX lite demos http://www.youtube.com/PropGFX·that'll give you an idea of the video abilities of the prop.
    resolution isn't as large as the 160x96, I put it to·120x96 for faster loading from SD.

    Baggers.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • vampyrevampyre Posts: 146
    edited 2008-06-04 07:00
    wow. truly amazing. i hadn't looked at the Prop GFX yet, that is just. wow. amazing. I'm drooling over here.

    are you using thomas rokicki's SD code or something custom? or is there some other secret to your systems ninja like speed?
    my images are around 15k, taking a hair under half a second each to load.
  • BaggersBaggers Posts: 3,019
    edited 2008-06-04 08:00
    Thanks [noparse]:)[/noparse]
    And yes, it's using Thomas Rokicki's SD code, unmodified [noparse]:)[/noparse] and I'm using byte per pixel, so it has access to all colours, and doesn't need converting, I made a avi-to-propavi converter, which converts each pixel to it's corresponding prop colour, and adds the audio track for that frame. [noparse];)[/noparse]

    I also use a less known trick, by padding each frame to align it to 512 byte chunks, as it's a LOT faster reading sectors than dividing them :P so I guess that's my secret ninja tip [noparse];)[/noparse]

    Baggers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • vampyrevampyre Posts: 146
    edited 2008-06-05 03:44
    hadn't thought of padding, thanks for the tip.

    my modification to Jeffs code is finally making a bit of progress, colors are converting a little better. I should be able to post the first version of the image viewer/converter this coming AM or the next day for anyone who want's to play with it.

    after i get that working i'm gonna try my hand at video. wont be any where near as good as yours but maybe it will be useful or fun to someone.
  • BaggersBaggers Posts: 3,019
    edited 2008-06-05 09:49
    excellent vampyre I look forward to your post, and videos to come [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • vampyrevampyre Posts: 146
    edited 2008-06-06 09:21
    i felt like i was hi-jacking this thread so i posted a new thread here
    http://forums.parallax.com/forums/default.aspx?f=25&m=272283

    the first version of my modified spudview is posted there
Sign In or Register to comment.