Colors!: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
 
(73 intermediate revisions by 18 users not shown)
Line 1: Line 1:
{{Activity migrated to sl.o
[[Category:Game]]
| download=http://activities.sugarlabs.org/sugar/addon/4050
| git=http://git.sugarlabs.org/projects/colors
}}


{{olpcboxtop|toptext=[[{{PAGENAME}}|Colors!]]}}
{{Status box
{{ OBX activity | [[Image:Activity-colors.png|40px]]|extra}}
| activity = Colors!
{{ OBX team | [[User:Wade|Wade Brainerd]], Jens Andersson, [[User:Loser]] }}
| icon = activity.svg
{{olpcboxbottom}}
| status = Under development
| version = 2
| base = No
| source = <!-- Repository / location of the source -->
| contributors = [[User:Wadeb|Wade Brainerd]], Jens Andersson, Robert Anderberg.
}}


{{RightTOC}}
= Colors! =
Colors is a simple natural media painting activity for the XO laptop. For more details, see the original development wiki page (hosted by Robert Anderberg): [[http://www.anderberg.co.uk/mediawiki/index.php/Colors!]]
Colors is a simple natural media painting activity for the XO laptop, based on a Nintendo DS program by Jens Andersson.


Rather than constructing images from geometric shapes, the user is encouraged to keep painting on their work until it looks right, starting with rough strokes and then adding extra details.
Rather than constructing images from geometric shapes, the user is encouraged to keep painting on their work until it looks right, starting with rough strokes and then adding extra details.
Line 22: Line 20:
You can see some art that has been created with the DS version of Colors! here: http://colors.brombra.net/
You can see some art that has been created with the DS version of Colors! here: http://colors.brombra.net/


= Screenshots =
[[Image:Colors-1 1.jpg|320px]] [[Image:Colors-1 2.jpg|320px]] [[Image:Colors_1_3.jpg|320px]]
A L B E R T I
paint factory


= Screenshot =
= How to Install =
Download this '''.xo''' file using the Browse activity: [http://dev.laptop.org/~wadeb/Colors!-13.xo Colors!-13.xo]
[[Image:Colors-1 1.jpg|320px]] [[Image:Colors-1 2.jpg|320px]]


== Wacom Support ==
= Instructions =
== How to install ==
Download this .xo file from the Browse activity: http://www.wadeb.com/Colors-2.xo
== How to play ==
Simply click anywhere on the canvas to begin painting. Use the icons in the toolbar to change brush features,


Colors! versions 11 and above support USB Wacom tablets, such as the [http://www.amazon.com/Bamboo-Small-Pen-Tablet-Only/dp/B000V9T2JA/ref=sr_1_22?ie=UTF8&s=electronics&qid=1228608694&sr=1-22 Wacom Bamboo] ($60 at Amazon). Wacom support requires OLPC Software Release 8.2.0, so update if you are on an older build.


To use your USB Wacom tablet with Colors, you need to do a little work at the Terminal.
= Development =


wget http://dev.laptop.org/~wadeb/setupwacom.sh
== Current Status ==
sudo sh setupwacom.sh


This will install the linuxwacom package, download and install the Wacom kernel module, and download and replace your Xorg configuration file with one that supports Wacom tablets.
Colors! is a fully functional (alpha) activity which runs well on the XO.


Restart your XO and launch Colors!. Voila, Wacom support! Check the Sensitive buttons in the Brush Control screen to enable pressure sensitivity for brush size and opacity.
We have not yet applied for project hosting and are working from a private Subversion server.
<nowiki>--~~~~Insert non-formatted text here
----
<s><br />Strike-through text</s></nowiki>


= Instructions =
[http://www.wadeb.com/olpc_colors2.jpg Screenshot 1]
[http://www.wadeb.com/olpc_colors3.jpg Screenshot 2]


Paint using the mouse. Painting controls are located in the Paint toolbox. You can watch your strokes replay using the Watch toolbox, and can view the bundled example paintings using the Learn toolbox .
== Developers ==


== Keyboard shortcuts ==
Jens Andersson - Original author
Wade Brainerd - Initial C++ port, Python port
Robert Anderberg - Developer
Marc Juul - Developer
Patrick Dubroy - Working with OLPC on touchpad support.
Eben Eliason - OLPC User Interface contact
SJ Klein - OLPC contact


{| border="1"
== OLPC Hardware Support ==
|-
!Key
!Action
|-
|Space
|Show or hide the brush controls panel.
|-
|Hand button
|Hold this while dragging the mouse to scroll around the image.
|-
|Z
|Zoom image in, for detailed painting.
|-
|X
|Zoom image out.
|-
|Alt + Letter or number
|Store the current brush. Note that you can store brushes while the brush controls panel is active.
|-
|Letter or number
|Retrieve a stored brush.
|}


=== Touchpad ===
= Development =
Colors is a standard Python activity that uses PyGTK for graphics and events. The canvas is managed by a custom C++ extension which handles painting, recording and playback, rendering to the screen, and loading and saving. All source code is included in the activity bundle.


Please see the [[Colors!/Development]] page for bug lists, todo lists, build environment instructions, etc.
The OLPC has a dual purpose touchpad / stylus area. Physically, it is a 3x wide touchpad divided into three rectangular sections roughly the size of a regular laptop trackpad.


== Testing ==
The center rectangle detects pressed fingers with analog "pressure sensitivity", although there are only about 8 levels (some of which are reached by hovering your finger over the touchpad).
Colors runs well on B4 laptops and build 656, however its development status is alpha and there are known bugs. It is functional enough to be used by children though, and bug reports are welcome (see the Development page).


== Feature requests ==
All three rectangles together form a stylus area roughly the width of the display above, and detect pressure from blunt objects (stylus) but without pressure sensitivity. In my experience, you have to press fairly hard to get anything out of them.


'''Independent collaborative mode:'''
==== OS support ====
* Participants select a picture from the journal or take a photo. This reference image is now fixed and cannot change.

* Participants can decide to limit the amount of clock time and/or drawing time to XX minutes (optional, can be unlimited)
As of build 651, OS support for reading the touchpad is pretty much broken. The the kernel driver for the tablet does not even support stylus mode, and when it does it simply reports stylus writing as mouse movement with no way to tell the difference. There is also no interface for reporting pressure sensitivity, etc.
* Everybody sharing the activity paints their own style based on the selected reference image. Paintings are NOT shared until...

* Each participant can mark their work as "Done"
Fortunately, it seems like it would be possible to read from the touchpad directly by opening a handle to "/dev/eventNN" (how to determine NN without trial and error is unknown) and reading the binary data directly from the hardware. The format can be found in the kernel sources "olpc.c" and "olpc.h", look in git.laptop.org for the kernel sources.
* Completed work can be viewed by all participants.

* Two paint recordings can be compared side-by-side (scaled to half width) with simultaneous playback.
I don't really trust the OS to report good data without all kinds of latency anyway (it's going through the X server after all), we may want to consider just reading the trackpad directly in the final app.

==== Self test ====

If you want to play with the touchpad and have an XO, power it on with the "left" joypad button pressed. This will start some diagnostic self tests, one of which is an interactive stylus test which shows both the touchpad and stylus activity as well as detected pressure and button presses.

=== Camera ===

The camera is currently accessed via GStreamer, though for better performance we could go straight to the video4linux C API.

== Ideas ==

=== Camera support? ===

I have something similar planned for the DS where you could capture or import a painting and have it displayed on the top screen so you could copy it on the bottom one. Design-wise, this works pretty well, and I like the fact that you can't carbon copy. On a 1-screen setup this needs to be retought.

Camera support is implemented in the Python version. You can take a picture using the XO webcam and it is superimposed over the canvas.

=== Collaborative painting ===

I've implemented a prototype of this using the DS's liblobby. It lacks proper synchronization and should probably be rewritten a bit to reduce performance peaks (by using one alpha/stroke layer per client). The XO feels like an ideal platform for this, and as I understood they may already have some sort of lobby funcitonality built-in? (the invite funcitonality).

Collaborative painting is now implemented in the Python version.

=== Use of the stylus area and touchpad simultaneously? ===

The OLPC touchpad can return both stylus information and touchpad information simultaneously. I wonder if we can do something with this, like use the center touchpad for finger painting, while simultaneously using a blunt object on the stylus area (left or right for left or right handed children) to affect the palette, alpha, and/or color simultaneously?

Or if we don't let them be used simultaneously, perhaps simply dragging an object on the left hand stylus area brings up the palette, so the stylus area becomes a physical representation of the palette. This removes the need to move the mouse cursor to change colors while painting.

=== Fingers as primary painting method? ===

I think finger painting is probably the ideal painting method since that's where the pressure sensitivity support is, and the stylus requires very hard pressure. The child will need to hold down a button while actually painting though to distinguish mouse repositioning from painting. This could be kind of awkward, since the motion will be: 1. Move cursor to desired location. 2. Hold down "paint" button. 3. Draw stroke with cursor using pressure sensitivity. 4. Release "paint" button.

The OLPC people have suggested a different approach for their painting application, where there is a way to move a rectangle around on the canvas, and strokes on the touchpad become brush strokes in the rectangle.

Other suggestions?

== Python version ==

Wade has rewritten Colors as a hybrid Python / C++ program and integrated it into the Sugar environment as an activity. This is the most full featured version and is where the development effort appears to be going.

Pros:

* Vastly simplified integration into the OLPC environment, we can use the OLPCGames framework which provides mesh networking wrappers, etc. Also the DBUS API which is used throughout OLPC is nicely wrapped by Python objects.
* Easier development since no substantial development environment is needed for Python work, aside from GCC for compiling the extension library.

Cons:

* Performance loss from Python script. The drawing code is now entirely in C++ so this is probably not significant.
* Code split from the C++ version. New features added to the DS and PC versions will be harder to bring to the OLPC version.

== TODO ==

=== Python version ===

==== Bugs! ====

* Toolbar goes blank sometimes.
* Brush sometimes freaks out.
* Playback meter in Watch screen doesn't always work right.
* Collaborative painting gets out of sync.
* YUV conversion in Reference Picture snapshot is incorrect.
* Activity is reported to leak memory.

Note- If you determine specific repro steps for one of the above bugs, please post it above.

==== Optimization ====

* Run oprofile on the activity on an XO during things like painting, videopaint, playback, report results here or via email.
* Change render_2x to use 32bit writes.
* Optimize draw_brush.
* Optimize videopaint_motion *after* improving the usability factor.

==== Usability / Features ====

* Display
** Need Activity SVG icon.
** Need Toolbar icons - videopaint, take reference picture, show reference picture.
** Add loading screen. Scrollbar appears over canvas, canvas updates in the background (repaint every 250 commands or so?)

* Features
** Improve key bindings ('p' for palette, 'v' for videopaint, 'r' for reference picture, these all are hard to reach).
** The ability to store the current brush in a hotkey and recall it. I'm thinking Ctrl-Any Key saves the brush to that key, and pressing that key brings up the palette screen (while the key is held) and restores the brush setting.
** Implement 'pick color' functionality with shortcut key (it is 50% there).
** Implement Zoom and Scroll (they are 90% there) with shortcut keys.
** Save reference picture in DRW file or else in Journal entry.
** Share reference picture between users when the activity is shared (just broadcast it whenever someone takes one).

* Input methods
** Pressure sensitivity support for OLPC Touchpad (Glide Sensor).
** OLPC Pen Tablet support.
** USB Wacom tablet support with pressure sensitivity. There are rumors of the Gen2 laptop having a touch sensitive screen, so this would help get us ahead of the game.

* Get rights to paintings in Learn panel.
* Approach an artist about making some short demonstration paintings that show off a specific technique.
* Ask OLPC devs about disabling the overlay that comes up when the mouse moves to the corner.
* Improve videopaint heuristic. Consider trying some more advanced computer vision techniques?

=== C++ Version ===

Most of the remaining work is integration into the OLPC frameworks. Things like saving to the Journal, collaborative painting via mesh networking, an OLPC-style toolbar, etc.

* Figure out optimal development environment - the standard XO image does not have enough room for GCC, all the GTK headers and import libraries, etc.
* Convert commandline-app into Activity
* Display should point directly to video-memory for optimal performance
* Research overlay-display possibilites?
* Pressure sensitivity from stylus?
* Application should use 1 display-layer without problems (CColors::SetupDisplays) - In progress, JA



== Setting up a development environment ==

* Download the highest numbered ZIP file from http://dev.laptop.org/pub/virtualbox/.

* Install VMWare Player

* Unzip the archive, open the VMX file inside in VMWare Player. I had to tweak the .vmx file a bit to get it to work but I'm using VMWare Workstation.

Note- Press Ctrl+Alt together to release mouse & keyboard focus from the VM.

* When the UI comes up, type in a name, then scroll to the right on the applications bar and launch Terminal.

* Set up some passwords at the Terminal. Note that in recent builds there is no longer a su command to become root, you have to use 'sudo' on each individual step you want to execute as root.

sudo passwd root (use 'olpc')
sudo passwd olpc (use 'olpc' again)

* Get your IP address.

/sbin/ifconfig

* Download FileZilla on your host machine and open a SFTP connection to the OLPC VM, login as 'olpc' / 'olpc' (the password you set before). You can now transfer files.

* Also download PuTTY and connect to the OLPC VM, this is easier than using their Terminal.

* Back at the Terminal ('su' to become root if you haven't aready) install GCC and the SDL libraries. I had to tweak some config files in /etc/yum.repos.d/ using nano, but they may have fixed the servers by now.

sudo yum install gcc
sudo yum install gcc-c++
sudo yum install make

SDL-devel is needed if you will be building the C++ version.

sudo yum install SDL-devel

* Install Subversion and check out from the repository.

sudo yum install subversion

For the C++ version

cd
svn co <url>/Smiles
svn co <url>/Colors

For the Python version

cd
svn co <url>/Colors.activity

* Alternately, check the projects out to your host machine and copy over the directories using FileZilla.

* For the C++ version, compile and run the C++ application

cd /home/olpc/Smiles/_OLPC
make
./run.sh

Hopefully it's now running. Ctrl-Esc exits.

For debugging, just run ./debug.sh from the _OLPC directory, this will drop you into GDB. For profiling, install valgrind using yum and run ./prof.sh.

* For the Python version, install the Python activity into Sugar and run it.

cd /home/olpc/Colors.activity
python setup.py dev

Now press Ctrl-Alt-Erase to restart XWindows. This will scan for activities and Colors should appear on the toolbar.

Re-launch Terminal, and run the activity.

sugar-launch Colors

For debugging, use

sugar-launch -d Colors

=== Profiling with oprofile ===

Oprofile is a system-wide Linux profiler. It's a pretty good way to see how the time is divided between Colors Python, Colors C++, X-Windows, the Display Driver and the Kernel.

When symbols are present, it can even show callstacks for top offenders, etc.

See http://wiki.laptop.org/go/Oprofile_setup for specific instructions on setting it up for the OLPC.

=== Editing code ===

I'm using Visual SlickEdit which has a "edit over SFTP" feature. I edit all the files directly on the OLPC VM, and do all my Subversion checkins / updates from the OLPC shell.

Another option would be to just edit and do Subversion operations on your PC, and then FTP the files to the OLPC after each change.

= Testing (No) =
Colors v1 has been tested on B4 laptops, however its development status is alpha and there are known bugs.

== Reviews ==


'''More Tools:'''
* Eyedropper
* Flip axis
* Load/Save


''Add your feature requests here!''
* Eraser tool (i.e., overwriting digital paint with background color) either as a brush-like tool or using back end of Wacom Bamboo stylus without selecting a new brush/mode.


== Constructive criticism ==


Wonderful activity! Nice job. [[User:Jpritikin|Jpritikin]] 22:23, 20 April 2008 (EDT)




Line 286: Line 108:


drawing, draw, coloring, colors, paint, painting
drawing, draw, coloring, colors, paint, painting
{{Activity page

|icon=Image:Activity-colors.jpg
[[Category:Software]]
|genre=Media, Audio, and Video Players
|short description=Colors is a simple natural media painting activity for the XO laptop, based on a Nintendo DS program by Jens Andersson.
|contact person=User:Wade
|bundle URL=http://dev.laptop.org/~wadeb/Colors!-13.xo
|activity version=13
}}

Latest revision as of 14:33, 14 December 2011

?Sugar icon}}    This activity is now hosted at the Sugar Activity Library.

The information here is likely to be out-of-date. Consult the new pages for "Colors!" first:

Activity-colors.png
OlpcProject.png Wade Brainerd, Jens Andersson, User:Loser

Colors is a simple natural media painting activity for the XO laptop, based on a Nintendo DS program by Jens Andersson.

Rather than constructing images from geometric shapes, the user is encouraged to keep painting on their work until it looks right, starting with rough strokes and then adding extra details.

The activity features soft brushes, collaborative painting, the ability to watch tutorial paintings as they are painted, and a variety of input methods including "video paint" using the webcam.

Here is a link to the homebrew DS version: http://www.collectingsmiles.com/colors/

You can see some art that has been created with the DS version of Colors! here: http://colors.brombra.net/

Screenshots

Colors-1 1.jpg Colors-1 2.jpg Colors 1 3.jpg A L B E R T I paint factory

How to Install

Download this .xo file using the Browse activity: Colors!-13.xo

Wacom Support

Colors! versions 11 and above support USB Wacom tablets, such as the Wacom Bamboo ($60 at Amazon). Wacom support requires OLPC Software Release 8.2.0, so update if you are on an older build.

To use your USB Wacom tablet with Colors, you need to do a little work at the Terminal.

wget http://dev.laptop.org/~wadeb/setupwacom.sh
sudo sh setupwacom.sh

This will install the linuxwacom package, download and install the Wacom kernel module, and download and replace your Xorg configuration file with one that supports Wacom tablets.

Restart your XO and launch Colors!. Voila, Wacom support! Check the Sensitive buttons in the Brush Control screen to enable pressure sensitivity for brush size and opacity. --~~~~Insert non-formatted text here ---- <s><br />Strike-through text</s>

Instructions

Paint using the mouse. Painting controls are located in the Paint toolbox. You can watch your strokes replay using the Watch toolbox, and can view the bundled example paintings using the Learn toolbox .

Keyboard shortcuts

Key Action
Space Show or hide the brush controls panel.
Hand button Hold this while dragging the mouse to scroll around the image.
Z Zoom image in, for detailed painting.
X Zoom image out.
Alt + Letter or number Store the current brush. Note that you can store brushes while the brush controls panel is active.
Letter or number Retrieve a stored brush.

Development

Colors is a standard Python activity that uses PyGTK for graphics and events. The canvas is managed by a custom C++ extension which handles painting, recording and playback, rendering to the screen, and loading and saving. All source code is included in the activity bundle.

Please see the Colors!/Development page for bug lists, todo lists, build environment instructions, etc.

Testing

Colors runs well on B4 laptops and build 656, however its development status is alpha and there are known bugs. It is functional enough to be used by children though, and bug reports are welcome (see the Development page).

Feature requests

Independent collaborative mode:

  • Participants select a picture from the journal or take a photo. This reference image is now fixed and cannot change.
  • Participants can decide to limit the amount of clock time and/or drawing time to XX minutes (optional, can be unlimited)
  • Everybody sharing the activity paints their own style based on the selected reference image. Paintings are NOT shared until...
  • Each participant can mark their work as "Done"
  • Completed work can be viewed by all participants.
  • Two paint recordings can be compared side-by-side (scaled to half width) with simultaneous playback.

More Tools:

  • Eyedropper
  • Flip axis
  • Load/Save

Add your feature requests here!

  • Eraser tool (i.e., overwriting digital paint with background color) either as a brush-like tool or using back end of Wacom Bamboo stylus without selecting a new brush/mode.

Constructive criticism

Wonderful activity! Nice job. Jpritikin 22:23, 20 April 2008 (EDT)


keywords

drawing, draw, coloring, colors, paint, painting

Activity Summary

Icon: Sugar icon::Image:Activity-colors.jpg
Genre: Activity genre::Media, Audio, and Video Players
Activity group: ,|x|Activity group::x}}
Short description: Short description::Colors is a simple natural media painting activity for the XO laptop, based on a Nintendo DS program by Jens Andersson.
Description:
Maintainers: ,|x|Contact person::x}}
Repository URL:
Available languages: ,|x|Available languages::x}}
Available languages (codes): ,|x|Language code::x}}
Pootle URL:
Related projects: Related projects,|x|Related projects::x}}
Contributors: ,|x|Team member::x}}
URL from which to download the latest .xo bundle Activity bundle::http://dev.laptop.org/~wadeb/Colors!-13.xo
Last tested version number: Activity version::13
The releases with which this version of the activity has been tested. ,|x|Software release::x}}
Development status:
Ready for testing (development has progressed to the point where testers should try it out): ,|x|Ready for testing::x}}
smoke tested :
test plan available :
test plan executed :
developer response to testing :