Showing posts with label Processing. Show all posts
Showing posts with label Processing. Show all posts

Friday, 20 November 2009

Processing the Flicker API

Digital Animation with Flicker

I've been experimenting with the Flickr Api this week and used it along with a sketch I had written previously for Chunk 16 images. I don't have that much experience of using Flickr, but it was relatively easy to use their API. The main problem I am having is that the URL I use seems to change on a daily basis. This would stop me posting an applet version on the Internet. Even if I got around this by not using my authority code I would still need to sign the applet as it gets its images from a different web site than the one where the applet started.
I used the flickr.interestingness.getList method in my URL to retreive the images. This returns the most viewed photos of the day on Flickr.
They have an excellent resource that can be used to generate the required URL. Processing doesn't need any extra libraries to use Flickr but it does require you to add 'format=json' to extras field when you fill in the details to allow it to use the images.
When you request the images you are sent an xml file with the details of the available photos. I just used Java substrings to get the info needed to build the photo URLs.

pids[i]=getTheString('photo id=');

I had to take down the images because the Flickr photos may not be licenced for derivative works...

Saturday, 17 October 2009

Snappy Happenings


I've been working on a Snap Happy Wedding game as a present for my sister. The amount of photos increased to 30, as I didn't want to leave anybody out. I had to edit all the photo's widths so they fitted on the cards. The music plays when ten snaps have been completed.
I changed the theme to the wedding colours and tartan.
I tried to use some freeware packagers for Java to make an easily installable package, but my files are for Processing. Perhaps I should make a main java class which loads the processing code but I'm not sure how to do this and info is a bit scarce.
In the end I found a 30 day trial version of a commercial program that works great with processing applications. Unfortunately, it would cost over 200 pounds to purchase! If the project were a success it would be worth the outlay but I cant justify this cost at the moment.

The installer generates an msi setup program that is great for Windows and there is an option for OS. Shortcuts are added wherever you denote and you can even have a product key that is checked online.
The file must be zipped if it is sent by hotmail or messenger but googlemail accepts it as it is. This is strange when you consider that the msi format is a Microsoft convention...

The photos in the lyrics section have a randomised tint applied.

Tuesday, 13 October 2009

Snappy Game in Processing


I've been working on a new version of the Snappy Game in Processing. It took me only 2 days to write. Most of the time was spent editing the photographs. My neice got married recently so I did a snappy game with pictures from the wedding.
One of the many advantages of Processing is that I can write the same code and have it run as an applet or an application. Applications can be set up to run in presentation mode or in their own sized window. I used the minim library for the sound, as it is really easy to use.
When the player completes the game I have it displaying the lyrics and playing the song that was played at the wedding service. Photos of the wedding are displayed on each page and I added a randomized tint to each one. This makes the photos look different each time it is run.
If I made this service available to users, I would need to decide whether to deliver the game as an applet or an application. I kept the size of the files down by converting the photos to PNGs and making them small but the final size is still over 10MB. If the game was delivered as an applet it might take a few minutes to load and some users experience java problems running the applets. I will likely test the load time this week sometime...
The standalone version loads very quickly and has less Java problems but set up is more complicated. The user would have to extract the folder from a zip file and double click the application icon.
If I set this up as a service I would need to find a way of letting the customer send me the photos. This would need to be done by email or file upload. It takes a while to edit the images and choice of music could cause copyright problems, I'm not sure how payment for a file in a one customer game works.
The game could be set up for any event such as a wedding, party or a baby's first birthday.
I think 25 pounds would be a fair price for the work involved, If anyone would like try out the service please contact me and we could work on it. :)