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.
It has three parts:
- Create the picture in photoshop, then set it to have 2 indexed colours (black and white), use dithering to deal with shading
- 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
- 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.
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.