Ben Simms

Creating a static tv effect

In the process of creating a little project I stumbled across a way to creating an effect that looks exactly like a de-tuned TV.  It’s so simple that you can do it yourself in a matter of seconds!

Copy this code into processing and run!

public void setup() {
  size(640, 480);
}
 
public void draw() {
  loadPixels();  
  for (int i = 0; i < pixels.length; i++) {
    float randomNumber = random(255);
    color c = color(randomNumber);
    pixels[i] = c;    
  }
  updatePixels();
}

What do we do here then?

Well, we set the size of the applet.

Then we tell Processing we want to fiddle with some Pixels so we call ‘loadPixels’.

Next, we create a little loop that finds every pixel and changes the colour to within the range of 0 – 255 which is the RGB value.

The last step is to update and that’s it, static TV… So real it’s scray!

Screenshot

Screenshot

Lord, give me colours! (Free Java app for generating inspirational colours)

Sometimes finding inspiration for the simplest task can be a challenge. That’s why I knocked together this app, “Lord, give me colours” will simply flash a sheet of six different colours every two seconds, if you like the colours you see, tap the screen and it’ll save you a screenshot to keep!

It really couldn’t be simplier, with only two seconds to decide you won’t be hanging around, your gut instinct will kick in and before you know it you’ll have a number of sheets full of funky inspirational colours.

For your convenience each run of colours you capture are placed into a timestamped folder.

Use them for logo’s, web design, painting your walls or even just for a nice wallpaper background, whatever takes your fancy!

Check out some example sheets below and get downloading for yourself!

Requires Java 7 to run.

DOWNLOAD

mac windows

EXAMPLES

Screen Shot 2014-07-27 at 17.27.46

Home

5

Sheet One!

3

Sheet Two

2

Sheet 3

3

Sheet 4

4

Sheet 5

 

Processing development in Intellij – 3 simple steps and pictures

Step One:

Assuming you have intelliJ and Processing installed, launch IntelliJ.

The first thing we are going to do is grab the core library.

File – Project Settings – Libraries – Add – Java

Screen Shot 2014-07-13 at 20.26.57Screen Shot 2014-07-13 at 20.29.34

Now select OK and return to your project. We must extend our class with PApplet (Processing Applet) this gives our class access to the Processing methods.

 

Step Two

Because we are using PApplet we have to tell IntelliJ where the main method lives, use the below code and make sure PApplet.main matches the name of your class.

Screen Shot 2014-07-14 at 08.51.10

  1. static public void main(String args[]) {
  2. PApplet.main(new String[]{"YOUR CLASS NAME HERE"});
  3. }

 

Step Three

 

As part of the build process we must tell IntelliJ where the module lies. Select the following button and hit ‘Edit – Configurations’

Screen Shot 2014-07-13 at 20.38.28

Screen Shot 2014-07-13 at 20.41.35

Now select the displayed module.

 

That’s it your now ready to run your Processing application by hitting the run icon (top right). Now you can enjoy the benefits that IntelliJ brings with it’s suggestive inputs etc..

Anytime Bulb Mode – Now exports a gif!

developed

I just added the ability to export an animated Gif, this way you can replay the construction process over and over again; looks pretty cool! The playback of the gif is very slow because the image is huge (for the web), so I need to find a way to compress the Gif before it finishes the animation, anyway it gives a good impression of how the app works

Anytime Bulb Mode

 

A few weeks ago I decided I should get back onto this project and see if I couldn’t fix a major blocker I had. The problem I had was with the motion tracking library, unfortunately the drivers for it were no longer supported and on-top of that I couldn’t get the basics running on the Raspberry PI.

With that in mind, I figured I would try and make my own version, a bit scary and perhaps optimistic but I thought “what the hell” and gave it a go.

Progress was slow to begin with, but I started to research the Capture library for Processing and realised it was smart enough to pick out every pixel colour it could find in an image or video feed!!! So all I had to do was think of a way to track the desired colour.

Some time later I got it to a working state. The behavior wasn’t exactly what I wanted, mainly I was tracking individual pixels whereas my previous library was able to find a collection or matching pixels at once, the difference being the old library would build the image much quicker and also create a nice outline image. (I’m still aiming for that effect)

Anyway, I started using my code to take some images and create some awesome art and I decided at this stage I would create a branch for it and also big it up a little.

The art was great and I could easily see it on an album or just all a sweet looking background!

 

Screen Shot 2014-06-21 at 21.38.38

The images below show the progression of my code and it’s behavior

Screen Shot 2014-06-21 at 21.40.37

Tracking a colour and drawing ellipses at the location.

Screen Shot 2014-06-28 at 11.09.05

Bigger ellipses and coloured. It was looking too real so I quickly deviated away from this effect

Screen Shot 2014-06-27 at 17.12.20

Not that you can tell, but at this stage I got the image drawing quickly

snapShot1404922432597

Switched to vertexs (which took quite some time) but the effect was much more inline with my previous app

snapShot1404931202168

Added more colours to paint with

snapShot1404924170863

An example result, what I call Star-mapping!

 

Sub Attack

1024x500Free Version Android:https://play.google.com/store/apps/details?id=co.uk.bensimms.subattackfree

Ad Free Version Android: https://play.google.com/store/apps/details?id=co.uk.bensimms.subattack

 

!!Grab yourself some Arcade Action!!

Please note, you can also purchase Sub Attack without the ads.

Welcome on-board captain, the ship is now yours! Take control of her, drop mines and blast the enemy submarines to pieces.

Don’t forget, if you can get a high kill chain you can call in crazy air support!
Look out for the golden submarines, they always carry goodies!

Features:
*Retro inspired game play, sound FX’s, music and graphics!
*Pick up and play gameplay (Perfect for commutes, sitting on the bog or just killing time)
*Build and collect insane power ups, including Space Invaders, big lasers and metal fences to name a few!
*Intuitive controls that work perfectly
*Simple gameplay with a growing challenge
Classic Arcade action in the palm of your hands!
The entire game for less than the price of one game in the arcade :)

 

promo1

 

promo2

 

promo3 promo4

Super Punch Bag – in the works

I set myself a little challenge this month, trying to catch some of the Flappy bird flotsam I’ve decided to challenge myself to make 4 games, all with a really simple yet infuriating theme. Enter ‘Super Punch Bag’

The game is simple, time your swings to hit the punch bag away from your face and into the shields. Clear all shields in one swing and you gain a point!

Yes, this game is hard!

I’m pretty much finished, just doing a bit of play testing, but expect to see this on the app store sometime soon :)

 

Screenshot_2014-03-03-13-34-20 Screenshot_2014-03-03-13-34-30 Screenshot_2014-03-03-13-34-39

A blast from the future – Short sci-fi story

About:

A blast from the future is a short story I wrote with the purpose of getting a vision out of my head and onto paper. If i had a video crew, special effects department and loads of money I would have made a short film, but I don’t; so instead… I present a story :)

 

A blast from the future

A fresh, cool and purposeful horizontal line of air was blowing in my hair, the wisp slowly

moved downwards in a calm but timely fashion, it settled briefly on my eye lids before moving down to my chin and back up again where it repeated the process.Slowly I began to open my eyes.

image taken from Forbes

I felt the softness of the foam mattress stiffen, it too started to turn cold. I tried to ignore the chill (which was now becoming frustratingly uncomfortable) by grabbing my blanket and tugging it over my head, it wasn’t long though before that turned cold. There was only one thing left to do, get up.

I slipped out of bed and stood on the warm panel projected on the carpet, a whirl of neon lights flickered beneath my feet but I cared not to watch, I was just waiting for the OK. The panel turned green; “Great”, I thought sarcastically “another perfect day in another perfect world”.

The aroma of grounded coffee beans penetrated the room and I started to feel a little more alive, my stomach rumbled which the house took note off. Looking into the wardrobe I could see a message from house informing me breakfast was on the go. Three draws silently opened, each one radiating a little heat. I put my hands in to take my garments but stopped on the third draw, “Not today” I said to the wardrobe, “I want my grey hoodie”.

One draw closed and another opened, there was my hoodie, much nicer than those all white, skin tight garments. I grab all three garments, my trousers went on first. At first I struggled to find the colour swab tucked within my pocket, but I was adamant that I wasn’t going out in white trousers again. I finally found the tab and moved my finger around on the plastic patch until I found a shade of blue I liked. Then I slipped on the hoodie and socks, both preheated the way I liked them.

I looked at my wife still sleeping and walked up to the bedroom door which effortlessly slid silently out the way. I was just about to step out when I noticed on the wall opposite me scrolling a message, ‘Wrist-com’ was flashing. “Damn” I said silently, I had almost forgotten, I walked over to my bedside table and rested my hand on it. A little blue light shone on my wrist, it moved around in a circular motion for a few seconds and then vanished as my wrist came alive with digital news, weather and the time.

Time to get breakfast I thought as I place my other hand over the Wrist-com.

As I left the bedroom, I slowly walked down the stairs. My current weight and health levels were being displayed at the bottom as a subtle reminder that I must visit the gym… “Not today” I whispered to house, I also gave house the finger, but it didn’t care to note that.

Entering the kitchen I was introduced to a new static background track I hadn’t heard before. It was the sound of a forest, light rain and animals walking, I hated to admit it, but it liked it.

My coffee sat waiting, I caught the colour of the mug fade from red to orange. I knew some people liked to have their coffee poured at a set temperature, but I preferred mine to cool down naturally.

Sat next to my coffee was a slice of toast. Shame, I didn’t want toast today. “House?”, “Yes” replied the house “I don’t want toast today, I’ll have fruit. Give the bread to the birds”

I pushed the rectangular plate into the track embedded into the kitchen table. A transparent lid slid into place and the vacuum was created, the plate slide one way and the bread another. As I looked through the kitchen window I saw the toast projected out of the waste shoot and float slowly down onto the grass, like confetti at a wedding, very satisfying.

My plate of fruit arrived before I had returned my eyes to the table. I tucked in enjoying the array of exotic fruits house had presented. “House”, “Yes Kyle” replied the house, “Show me Isabel” The table came alive with a video feed enhanced by night vision, she was still sleeping, her cot statistics projected on the floor around her suggested she would likely be asleep for another 36 minuets. From the data it looked like she’d had a good sleep, she had entered R.E.M earlier than normal last night suggesting she was more tired than normal. I denied the feed on my Wrist-com, pushed my plate into the track and headed to the bathroom.

A fine fragrant mist landed over me, it quickly penetrated my clothing and I felt damp, but within a heartbeat, I was dry again. House kindly informed me cleansing was complete.

I grabbed the purple PowerMouth liquid from the bathroom sink, I could just about make out a cluster of nano bots hanging together. I’ve never liked that, not when you can actually see them… I gave the bottle a vigorous shake turning the purple liquid into a semi reflective purple. Two shots into the mouth and my teeth where cleaned.

I looked at my wrist and I could see the activity of the nano bots, they had already cleaned 45% of my mouth. I tapped my wrist twice, who want’s to see that running all day?

I remembered the sensation of the first time I started using this nano mouth wash, I felt disgusted because a cluster of bots failed to break down a fragment piece of pizza dough quick enough, so rather than feeling a nice liquid dust, I felt a hard drop of squishy dough, which almost made me choke, that was when the bots were new. PowerMouth had since been advertising these new purple bottles and to be fair, they seemed to work.

I turned to leave grabbing my coat of the hanger, it was a metal hanger screwed into the wall, some technology just works.

Swinging the coat over my back and through the arms I felt the slight compression, I wished that my wife would stop buying me these tight fitting outfits. I pulled my hood out and let it settle into place. My coat quickly reconfigured itself to take away the newly acquired space generated from the removal of my hood.

My Wrist-com shone through the white sleeve of the coat making all the graphics and text blurry but readable. I used two fingers and slide down my wrist to darken the projection. Time to get the car I figured.

As I approached the front door the key panel was flashing orange, the house started speaking “Karl, you haven’t” I interrupted; I knew what house was going to say. “Yes! alright I do it now”. I tapped the panel with my thumb twice, my little finger once, then made a clockwise motion with my index finder. House announced the new password was sufficient and the front door slid open. I mumbled to myself about getting retina locks and stepped out into the garden.

The car door was open and the arrival time of work displayed in the glass of the entry window. I slipped in. “Morning Kyle” car announced, I didn’t reply. The door slid shut and made a slight hissing sound. Without a word the car began move forward, I was gently forced into the seat by the motion. “Warmer seat and coffee please”. The seat instantly warmed my arse and the heat quickly rose up my back, I think the coat misheard the command, either way it felt comfortable.

A red coffee cup presented itself at the end of the arm rest, I could see the gyroscope cup-holder swinging left and right as the car thrust around corners, I always found it slightly reassuring to see old theories still in practice.

Through the windscreen the news was playing, again my car decided to display 20 news channels at once. This was a re-occurring offense and I had my concerns this car was starting to get a personality of it’s own.

You’re tired Kyle, with your stress and tiredness level currently settling around 30% we could take it down to 22% with a quick power nap before your arrival at your office, would you like me to induce sleeping agents?”

This damn car, I knew buying it was a bad idea, I missed the old cars, they could only talk about directions and repair instructions. I did however feel tired and the coffee wasn’t kicking in. “Yes” I said, “go on then”. I heard a little hiss from behind my ears and my eyes soon snapped together… I was out.

Who knows how long I was out, but a loud bleeping noise pierced right through my ear drums, it was mechanical and obtrusive, my eyes were still heavy from the sleeping agent, it took me some time to orientate myself, with my eyes half closed I reached out my hand and thumbed around to find the source of that repetitive screech, my fingers slid across a black smooth plastic object, I tried to grab the object and bring it closer to my squinted eyes so I could see the screen, but it slipped out of my fingers and feel to the floor. The damn noise was now even further out of reach and all my efforts to mute it had been wasted. There was only one thing left to do, get up!

The Tiny Gif Maker – My new Java app… Finished

The Tiny Gif Maker!bensimms.co.ukA sweet little tool for quickly creating animated gifs from your own live video feed!

You can use these exported micro gifs on forums, web posts, comment replies or even little ico’s.

You can download the mac version here for free and I’ll look into creating a windows version.

bensimms.co.uk

Features Include:

  • 3 set sizes to export too
  • Add as many or as little frames as you like
  • Automatic looping
  • Individual frames exported
  • Great quality image low export size
  • Takes only seconds!
  • Can be used to create funny little animations

Requirements:

  • Mac OSX
  • Java 7 or above
  • Web Cam (tested with Mac Book air)

The Tiny Gif Maker Postmortem

So this is probably my first bonified “end to end” Java application and it’s far from perfect so for my postmortem ill start with what I don’t like or, what went wrong.

Firstly the size of this app, for what it does, this app is huuuuge, it’s about 40mb unzipped, the main reason for this is the number packed in extras such as the dynamic libraries and jars required to get processing running, but at this stage I don’t want to risk breaking things so I left them in.

Secondly, the interface, after getting the code working, I started putting graphics in and this became a lot more challenging than it should had been, so in the end I just used a series of images that are accessed when key’s pressed. Not ideal, in-fact it’s pretty crap but hey it works (if you do what your supposed too).

Thirdly, on launch if the app cannot find a web camera, rather than tell the user this the app will just close,.

Anyway, this project was a small project for me and was more about learning Java more than anything else and I learned a lot!

I used two main libraries to achieve this app, the life saver one was called gifMaker and this allows you to import a number of images and it will create an animation out of them, for me though, I needed to use the web camera and that was my second library the embedded Processing camera library.

It was easy enough to capture the frames from the web cam feed, but piecing them together to export as an animated gif was not so.

I hit a ton of issues with this, mainly because I wasn’t aware of some of the methods available in the gifMaker library (lesson learned, Make sure you overview all the methods before using a library). Once I had this side of things working I was really happy with myself. I figured the next part would be a piece of piss, because all I wanted to add was the feature to allow users to pick a size. In my mind it worked like this, they press a number say 1, and the screen re-sizes, when the user presses ‘Spacebar’ to capture a frame, the frame captured would be of the same size.

This actually was much harder (two days on and off) worth of playing and testing. The problem I hit (and it seems obvious now :) ) was making the camera object in the setup method. Processing uses the setup method to do things such as size the Java application window and it’s only called once (as far as I can tell), I couldn’t figure another way to call it again later in the script.

So in my setup I was setting the camera window size to match the Java application size, then when a user changes the java application size I was expecting the frame image to match… But it didn’t because the camera object size hadn’t changed…

To fix this I finally figured out I should create a new instance of the camera object when the user presses the export size button, this way I could dictate the camera size every time, thus Processing would be happy when I capture the frame. Whoo!

And that’s about it, or as much as I can bear to write about it for now at least :) I thoroughly enjoyed creating this app, it’s been a nice distraction from my ATB project.

« Older posts

Copyright © 2014 Ben Simms

Theme by Anders NorenUp ↑