<p>I woud like to create a cross-platform drawing program. The one requirement for writing my app is that I have pixel level precision over the canvas. For instance, I want to write my own line drawing algorithm rather than rely on someone elses. I do not want any form of anti-aliasing (again, pixel level control is required.) I would like the users interactions on the screen to be quick and responsive (pending my ability to write fast algorithms.)</p>

<p>Ideally, I would like to write this in Python, or perhaps Java as a second choice. The ability to easily make the final app cross-platform is a must. I will submit to different API's on different OS'es if necessary as long as I can write an abstraction layer around them. Any ideas?</p>

<p>addendum: I need the ability to draw <em>on-screen</em>. Drawing out to a file I've got figured out.</p>

[{'answer_id': 67089, 'author': 'shoosh', 'author_id': 9611, 'author_profile': 'https://Stackoverflow.com/users/9611', 'pm_score': 0, 'selected': False, 'text': "<p>QT's Canvas an QPainter are very good for this job if you'd like to use C++. and it is cross platform.</p>\n\n<p>There is a python binding for QT but I've never used it.</p>\n\n<p>As for Java, using SWT, pixel level manipulation of a canvas is somewhat difficult and slow so I would not recommend it. On the other hand Swing's Canvas is pretty good and responsive. I've never used the AWT option but you probably don't want to go there.</p>\n"}, {'answer_id': 67259, 'author': 'Steve Landey', 'author_id': 8061, 'author_profile': 'https://Stackoverflow.com/users/8061', 'pm_score': 2, 'selected': False, 'text': '<p>The <a href="http://www.pyglet.org/" rel="nofollow noreferrer">Pyglet</a> library for Python might suit your needs. It lets you use OpenGL, a cross-platform graphics API. You can disable anti-aliasing and capture regions of the screen to a buffer or a file. In addition, you can use its event handling, resource loading, and image manipulation systems. You can probably also tie it into PIL (Python Image Library), and definitely Cairo, a popular cross-platform vector graphics library.</p>\n\n<p>I mention Pyglet instead of pure PyOpenGL because Pyglet handles a lot of ugly OpenGL stuff transparently with no effort on your part.</p>\n\n<p>A friend and I are currently working on a drawing program using Pyglet. There are a few quirks - for example, OpenGL is always double buffered on OS X, so we have to draw everything twice, once for the current frame and again for the other frame, since they are flipped whenever the display refreshes. You can look at our current progress <a href="http://cwru-hackers.googlecode.com/svn/splatterboard/" rel="nofollow noreferrer">in this subversion repository</a>. (Splatterboard.py in trunk is the file you\'ll want to run.) If you\'re not up on using svn, I would be happy to email you a .zip of the latest source. Feel free to steal code if you look into it.</p>\n'}, {'answer_id': 67298, 'author': 'Jonathan Hartley', 'author_id': 10176, 'author_profile': 'https://Stackoverflow.com/users/10176', 'pm_score': 4, 'selected': True, 'text': '<p>I just this week put together some slides and demo code for doing 2d graphics using OpenGL from python using the library pyglet. Here\'s a representative post: <a href="https://www.tartley.com/posts/pyglet-week-2-better-vertex-throughput/" rel="nofollow noreferrer">Pyglet week 2, better vertex throughput</a> (or <a href="https://www.tartley.com/posts/flying-high-hobbyist-opengl-from-python/" rel="nofollow noreferrer">3D stuff using the same basic ideas</a>)</p>\n<p>It is very fast (relatively speaking, for python) I have managed to get around 1,000 independently positioned and oriented objects moving around the screen, each with about 50 vertices.</p>\n<p>It is very portable, all the code I have written in this environment works on windows and Linux and mac (and even obscure environments like Pypy) without me ever having to think about it.</p>\n<p>Some of these posts are very old, with broken links between them. You should be able to find all the relevant posts <a href="https://www.tartley.com/categories/graphics/" rel="nofollow noreferrer">using the \'graphics\' tag</a>.</p>\n'}, {'answer_id': 67445, 'author': 'Toni Ruža', 'author_id': 6267, 'author_profile': 'https://Stackoverflow.com/users/6267', 'pm_score': 0, 'selected': False, 'text': '<p>I would recommend <a href="http://www.wxpython.org/" rel="nofollow noreferrer">wxPython</a></p>\n\n<p>It\'s beautifully cross platform and you can get per pixel control and if you change your mind about that you can use it with libraries such as pyglet or agg.</p>\n\n<p>You can find some useful examples for just what you are trying to do in the docs and demos download.</p>\n'}, {'answer_id': 69554, 'author': 'DarenW', 'author_id': 10468, 'author_profile': 'https://Stackoverflow.com/users/10468', 'pm_score': 1, 'selected': False, 'text': '<p>If language choice is open,  a Flash file created with Haxe might have a place.  Haxe is free, and  a full, dynamic programming language.  Then there\'s the related Neko, a virtual machine (like Java\'s, Ruby\'s, Parrot...) to run  on Mac, Windows and Linux.     Being in some ways a new improved form of Flash, naturally it can draw stuff.  <a href="http://haxe.org/" rel="nofollow noreferrer">http://haxe.org/</a> </p>\n'}]
['https://Stackoverflow.com/questions/67000', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10093/']