David Wicks
YaBB Newbies
Offline
Posts: 24
CA
Re: Processing Progra to react to MySQL Database input
Reply #1 - Apr 12th , 2010, 7:00pm
You'll want to break your task down into a few steps, which you have already started to do. There are two major components to what you are attempting, one of which must be done on the server. Processing is a great tool for image manipulation, but it doesn't easily export to server-side scripts. To get started on the pixelation, I would first look at the pixels[] array: http://processing.org/reference/pixels.html Loop through the pixels, and at each step, draw a rectangle with the color of the current pixel. For example, you could skip every other pixel, and draw a 2x2 rectangle at each step. This might be the first thing you want to get working, and is definitely the one Processing is most suited to. For uploading images, you'll need to use a server-side script; processing applets run on the client-side. Look for php, python, or ruby code that handles image uploading. Something like http://codeigniter.com/ or http://www.sinatrarb.com/ might make that process easier. To run the program each time an entry is put into your database, you'll need to have your script that updates the database know about your processing app and run it (and have permissions to run the app on your server). It might be simpler to have your processing applet run whenever someone visits the page, and have it get fresh data from your database each time.