Shop OBEX P1 Docs P2 Docs Learn Events
Running a Presentation from a Propeller - putting a BMP in VGA? - Page 10 — Parallax Forums

Running a Presentation from a Propeller - putting a BMP in VGA?

1567810

Comments

  • TumblerTumbler Posts: 323
    edited 2012-06-02 22:50
    Phil,

    What are the pps files? images?
    Are you using a converter to create the pps files?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-02 22:56
    Yes, the pps files are specially-compressed images for the slide program. I use a converter that I wrote myself in Perl to create them from PNG files.

    -Phil
  • RaymanRayman Posts: 14,827
    edited 2012-06-03 05:19
    Tried it and it works great. I think that's about as good as it can possibly get for native Propeller graphics...
  • ClemensClemens Posts: 236
    edited 2012-06-03 12:08
    Wow, Phil this is absolutely amazing.
    I never thought images of this quality are possible with the prop and no additional hardware. "¡Viva la propeller!"
    The images could be further improved on a per-pixel basis.
    Straighten the boards' edges, refine details etc.
    Cheers,

    Clemens
    224 x 160 - 8K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-04 15:38
    I've changed the suffix of the data files from .pps to .pvd (Propeller VGA Data). PPS is used for PowerPoint Slides, and it would be very confusing to use the same suffix with this app.

    Attached is a Windows .exe that can be used to convert PNG files to PVD files. Also attached is an updated version of the slide show program, sans slides this time. (You can create your own now.)

    Here are the rules for creating PNG files for use with the converter:
    1. File dimension must be a native (i.e. not reduced from a bigger size) 640x480 pixels encoded as PNG. 24-bit color is okay.
    2. Each file is assumed to have mostly two-color areas of text and simple graphics, with possibly one rectangular area of high-color imagery.
    3. The image is divided into a 20W x 32H grid of blocks, each 32 pixels wide by 15 pixels high. The boundary of the high-color area is assumed lie on the grid.
    4. When creating text or other two-color objects in a program like Photoshop, PhotoPaint, or Gimp, make sure that anti-aliasing is turned off.
    5. You can use different colors for the two-color area if you like. The limitation is that any given row of pixels must contain no more than two colors, excluding the high-color area.
    6. Graphics in the two-color area do not need to be locked onto the grid.
    7. The program will report the final file size. If it's bigger than 26000 bytes, it will not work with the slide program.

    This program is still very alpha. Inferring the high-color boundary is really primitive and may not always succeed. So please let me know if you encounter problems or results that you do not expect.

    Thanks,
    -Phil
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2012-06-04 16:43
    Absolutely amazing! Can't wait to put this to work with some of my own graphics.

    On another amazing sidenote, I looked back to the first post and ran a calculation through TimeandDate.com. From Ken's starting of this impossible thread to Phil's posting of a basically complete solution: 21 days, 22 hours, 17 minutes.
  • Ken GraceyKen Gracey Posts: 7,400
    edited 2012-06-05 07:56
    Hey all,

    Just a quick check-in to let you know that I'll be back to this thread by Wednesday afternoon to try out the latest examples from Phil and Ray.

    I'm still on target to do this presentation as planned, from the Propeller.

    Today I am going to the airport to pick up Gordon McComb. Shall see if Gordon survives a full day at Parallax - we didn't tell him how booked he'd be at Parallax else he'd think twice about coming to see us!

    Ken Gracey
    Parallax Inc.
  • TumblerTumbler Posts: 323
    edited 2012-06-05 09:00
    Nice work Phil and thx for the update :thumb:
  • ClemensClemens Posts: 236
    edited 2012-06-05 16:35
    The converter is fun to use and works very well.
    It would be cool if an image, that already obeys the rules and has the right colors would not be recalculated.
    The attached image shows what I mean: I manually painted over the edges and some details, and I think it complies with the compression but still some recalculations are applied when imported.

    slide_evolution.png
    640 x 480 - 30K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-05 19:43
    Clemens,

    Thanks! I'm glad you've had a measure of success with the program.
    It would be cool if an image, that already obeys the rules and has the right colors would not be recalculated.
    You raise an interesting point. Examination of your input image does suggest that no changes are called for, but minor changes do occur. For example, the light yellow vertical stripe on the far left DB9 connector gets changed to a dithered gray. I'm looking into this right now.

    Thanks for your careful review!
    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-05 19:57
    I've figured it out. One of the rules is that each block of 16 fat pixels can contain at most four different colors. When there are more than that, the four most popular colors are chosen. Here's an extreme blowup of the DB9 connector, with a block of pixels outlined in red:

    attachment.php?attachmentid=93278&d=1338951415

    There are five colors in that block, and light yellow is in the minority, tied with black. One of them has to get the boot. It happens to be light yellow in this case.

    -Phil
    899 x 679 - 21K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-05 20:20
    BTW, Clemens, how did you produce your version of that slide? It really turned out nice!

    -Phil
  • ClemensClemens Posts: 236
    edited 2012-06-06 14:40
    Okay Phil, I understand now.
    Attached are 4 slides that now really comply...i think.

    Inspired by your demo-charts I tried out various strategies.
    The charts were built in Photoshop and the images aligned to use as few "tiles" as possible.
    I scaled the one with the two boards so the holes of the breadboards align with the two-pixel grid.
    Then I ran your converter on it, did a screenshot of the resulting image and manually painted on it.

    I think images look nicer when they are cut out - and it also saves a lot of memory so you can make them bigger.
    Also avoiding palette changes helps to keep file size low of course. So the one with the bot was converted to black, white and the two neutrals from the prop palette, then converted and partially mixed with a full color version.
    The one with the big Prop BOE was done similarily, with a Palette of black/white/dark blue/light blue mixed with a colored version.

    The one with the Quad-Copter was done without any adjustments...

    Thanks again for making this. - It has been fun. In these retina-display times it's nice to see some pixels again.
    Can't wait to see what you guys will be creating with the prop2.


    slide001.png
    slide002.png
    slide003.png
    slide004.png
    640 x 480 - 30K
    640 x 480 - 15K
    640 x 480 - 23K
    640 x 480 - 31K
  • ClemensClemens Posts: 236
    edited 2012-06-07 11:07
    Here is another one that stays just below the memory limit:
    slide005.png

    Yes, it's the Parallax Font for the Headline :-)
    640 x 480 - 24K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-07 11:34
    Clemens,

    That turned out nice! Do you do graphic design for a living?

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-07 13:46
    In order to finish this up as a useful tool, I built an XBee-based remote control for the slide presenter. Here are a couple photos. There was room for a spare battery, so I used a P-clip to hold it:

    attachment.php?attachmentid=93338&d=1339101672

    attachment.php?attachmentid=93339&d=1339101673

    Here's a schematic. That's about as simple as things get with an XBee. I used a Parallax 5V3.3V adapter, but that's only because I didn't have the simpler adapter on hand:

    attachment.php?attachmentid=93336&d=1339101671

    The transmit XBee had to be configured for standalone operation and the receive XBee for API mode. The relevant modem configuration profiles are attached in the archive, along with the Spin source code. On the PropBOE, I jumpered the XBee DO pin to P0 to connect it to the Propeller.

    -Phil
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-06-07 22:17
    Amazing work guys!!!!!!!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-08 15:13
    Okay, this really could be my last installment. :) Attached is an archive that permits either XBee or hardwired pushbutton switch control over the presentation. Copy the .pvd and .sfx files to your micro SD, and plug a speaker into the audio for some sound effects!

    -Phil
  • Ken GraceyKen Gracey Posts: 7,400
    edited 2012-06-15 11:03
    Hey all,

    The person who started this endless R&D cycle has arrived to test out the results. I'm humbled by the reply here. We've been out at a number of activities this spring - at some point I realized I had been gone from home for five of the last six weekends! Now that that has stopped we're making preparations for the next round of activity, using Propeller Presenter! Some of the upcoming trips are a bit secret in nature [no, it's not a pre-release tour for Propeller 2], but once they're underway I'll be able to share more details. Some of the places we'll visit include Pittsburgh, Las Vegas, Portland, Colorado and Europe.

    Ran Phil's examples today on a 32" TV with VGA input and they worked wonderfully. Even on the big screen from a projector this will be of high enough resolution. I'm happy that the images are more grainy that bitmap retro, too. I really look forward to freeing myself from a laptop at these presentations - can you imagine walking up with a PropBOE in your pocket, plugging it in and doing a presentation? There's nothing as productive as demonstrating hardware instead of talking about it - what a great way to show the Propeller. I'm not sure if my other demos will run from the same hardware or not at this point. Depends on what I decide to do.

    Next up is to start using the png2pvd program to convert my own slides. First I need to learn how to optimally design a slide for the best display capability. To do this I shall visit Phil in Port Townsend on Monday and Tuesday and ask him a few questions in person.

    I'll be back with more reports as they become available!

    Ken Gracey

    Viva Propeller.jpg
    600 x 448 - 60K
  • HShankoHShanko Posts: 402
    edited 2012-06-15 15:07
    It appears the 'group effort' by those working on this presentation effort has resulted in a great bonus for Parallax.

    We all want the Propeller success. Looks like optimization, tweaking, re-looking at error terms has resulted in something Ken should be able to surprise his audences. Will be interesting to hear of the feedback after his presentations at the listed sited.

    Yes, ¡Viva la Propeller!
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-06-15 16:32
    Ken Gracey wrote: »
    ... First I need to learn how to optimally design a slide for the best display capability. To do this I shall visit Phil in Port Townsend on Monday and Tuesday and ask him a few questions in person.
    You may want to see about visiting Clemens (wherever he is) as he seems to grasp the limitations, and also have a good handle on designing around them.
  • ClemensClemens Posts: 236
    edited 2012-06-15 17:20
    Hi Phil,
    yes I'm a graphic designer. I got interested in the propeller when I wanted to build a panorama robot a few years ago - successful thanks to the kind guidance of the helpful people on this forum:
    (http://forums.parallax.com/showthread.php?105144-Finished-Project-PanoCam&highlight=panorama)

    I just did a quick video test with your slideshow program by commenting out lines 72, 84 and 88 of the code (the waitcnt lines) and putting the attached images onto the sd card:
    video.zip
    It does work quite well! - of course the background causes some flicker and sometimes there are strange color artefacts...
    How well this works is probably depending on the speed of the sd card?
    Cheers,

    Clemens

    EDIT: Line numbers refer to "slide_show3.spin". The later versions are no longer autoplay so some additional changes would be necessary to try out video.
  • ClemensClemens Posts: 236
    edited 2012-06-15 17:34
    You may want to see about visiting Clemens (wherever he is) as he seems to grasp the limitations, and also have a good handle on designing around them.

    That's Berlin, Germany ;-)
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-06-15 17:57
    Viva la Propeller !

    I have really enjoyed watching the participation in this effort. It's out of my league here to participate. However, as Clemens said, this is a great forum where help and participation is simply superb.

    Ken, the response will be amazing to use the PropBOE to demo your slides. As you said, it doesn't have to be perfect but it does indeed show off what the prop can do. And if the prop can do this then the audience will realise that i can do lots of things.
  • Ken GraceyKen Gracey Posts: 7,400
    edited 2012-06-15 17:59
    Clemens wrote: »
    That's Berlin, Germany ;-)

    Willkommen Sie im Forum. Berlin ist eine wundersch
  • ClemensClemens Posts: 236
    edited 2012-06-15 18:28
    Hi Ken,
    well it's better than the Google Translator, that's for sure. Coincidence? - In '87/'88 I've been an Exchange Student in Watertown, NY near lake Ontario. I still miss the place sometimes...
    Clemens
  • RaymanRayman Posts: 14,827
    edited 2012-06-17 07:09
    Finally had time to put the VGA plugin onto the BOE for Ken. I think it doesn't look too bad and works perfectly:

    BOE_VGA.jpg


    So, now he has a choice between 80's looking graphics with stock BOE or modern graphics with an extra board plugged into BOE.
    1024 x 768 - 117K
  • SapiehaSapieha Posts: 2,964
    edited 2012-06-17 08:34
    Hi Rayman.

    Looks Very Good

    Rayman wrote: »
    Finally had time to put the VGA plugin onto the BOE for Ken. I think it doesn't look too bad and works perfectly:

    BOE_VGA.jpg


    So, now he has a choice between 80's looking graphics with stock BOE or modern graphics with an extra board plugged into BOE.
  • RaymanRayman Posts: 14,827
    edited 2012-06-17 13:50
    Ok, converted the slides to VGA BMP via simple screen capture.
    Here's what it looks like using a projector:

    BOE_VGA_Projector.jpg
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-06-17 15:13
    That looks nice!

    -Phil
Sign In or Register to comment.