Switch branches/tags
Nothing to show
Find file History
Pull request Compare This branch is 2 commits behind JoshCheek:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
draw.sikuli
Readme.mdown
bobafet.png
bobafet.psd
machete.png
pikachu.png
pixel_generator.rb
pixels.txt
results.png
rocketeer.png
rocketeer.psd
velocity-and-acceleration.gcx

Readme.mdown

Description

For my physics course, we are using webassign, which lets you do your homework online. Some of the questions have a flash drawing app with a black 1 pixel pencil tool. This code draws pictures onto it.

Here is the final result, which I submitted. results.png

Usage

It has three parts:

  1. Create the picture in photoshop, then set it to have 2 indexed colours (black and white), use dithering to deal with shading
  2. Pass the name of the picture to the ruby script, which will generate a file pixels.txt containing x/y locations of black pixels in the image it was given $ ./pixel_generator.rb pikachu.png
  3. Load webassign (or whatever your target is) in the background then run the sikuli script (possibly adjust the offsets)

It will take over the mouse, and draw a pixel on the background image as specified in the pixels.txt file.

Dependencies

Sikuli ImageMagick rmagick (2.13.1)

Imagemagick absolutely sucks to install. However, on Snow Leopard, it worked correctly for me the first time using macports.


This code is unmaintained.

If you do something interesting with it, let me know so I can be happy.


Copyright (c) 2010 Joshua Cheek

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.