Trying to find an "Idiot-Simple" graphics package to use with Python - any help for me?

Anybody got any suggestions for a “stupid-simple” Python graphics package? I don’t need or want a “swiss-army knife” package that “can do anything graphical that you can possibly imagine, as long as you don’t mind spending days/weeks/months learning every nook and cranny of the code, and using dozens, if not hundreds, of lines of setup code to accomplish even the most trivial task”. I just want a simple, functional package that will let me do something essentially like this:

import InsertNameOfMyDreamGraphicsLibraryHere as g

MyGraphicsWindow=g.MakeGraphicsWindow(HorizontalSize, VerticalSize, BackgroundColor)



and get exactly what that code describes: A window on the screen with a “Color”-colored dot located at point X,Y in it.

Just as important (and where John Zelle’s “” package, which I was attempting to use falls down - HARD) is the ability to do this with potentially ridiculous numbers of points without taking a performance hit (in either time, or memory used). Zelle’s package is simple enough, and can accomplish the task, but it slows to a crawl - No, make that a “sub-crawl” (Might even be more accurate to say that it just plain lapses into an all-out coma…) and starts gulping RAM like they’re planning on outlawing it tomorrow once you get past a certain number of points. (as of yet, it’s not clearly established what that number is, and frankly, I don’t care, other than to note that it’s apparently a good deal lower than the number of points I’m trying to work with)

That’s all I need. Nothing else. No scaling, no animation, no rotation, no shape-drawing or 3-D projections, no zoom/pan action that’ll let you look at the dot from any angle imaginable by man, god, or creatures from Dimension X - nothing but the ability to place a dot of a specified color at a specified X,Y point in a window. A few “add-ons” like “DrawALine()” or “DrawACircle()” might eventually come in handy now and then (and honestly, would be trivial to build up from the “make a dot” functionality I need most), but even they would be far beyond what I actually want/need for my task.

Is this REALLY so big an ask??? I’m starting to think so, seeing as how every graphics package I come across is either ridiculously bloated and tries to do absolutely everything, with a learning-curve that resembles a climb up the north face of K2 before you can do anything at all with it, and requires idiotic amounts of setup code (which can’t be generated without who-knows-how-long spent slogging through picking up the idiosyncrasies of the particular package, rather than getting on with completing the task you’re actually trying to accomplish) or is (or in the face of any real “challenge”, such as a large number of points, becomes) so slow as to be effectively unusable.

40-some years ago, the capability I’m looking for was built into the comparatively primitive language (AppleSoft BASIC) that came baked into the ROMs of every Apple //e ever made, fergawdsake! If you wanted to draw a green dot on the screen at X=12,Y=38, the following line is THE COMPLETE PROGRAM NEEDED TO DO IT - no add-ons/plugins, no “helper code”, no callouts to assembly/machine language code, no extensive setup - Just this one lonesome line of code accomplished the task, and did so without slowing down to the point of wondering if it would complete within my lifetime when done many times:

10 HGR : HCOLOR=1 : HPLOT(12,38)

(And before somebody raises the “Yeah, but there was assembly code underlying it” concept, indeed there was - and when you looked at that underlying assembly code, it was crazy-simple, consisting of bumping a couple of soft switches (by reading from a specific trio of bytes in memory) for the HGR statement, moving the input values (the HColor value, and the values 12 and 38) into known locations for easy access, and doing a nearly trivial “Since X is 12 and Y is 38, that means means we need to tickle this particular byte in memory” calculation - a task that was accomplished with a bit more than a dozen Assembly Language instructions - before doing a shift and a bitwise OR on the calculated byte. Task complete.)

Yet 40-odd years later, in python, a language that’s touted as being light-years ahead of anything (Other than perhaps C) that was available back then, I can’t find a way to do this trivially simple task without needing (at least) an add-on module and who-knows-how-many lines of setup code before I can start to think about putting my first dot on the screen! This is “progress”?

Gah… pardon my rant - This topic (not being able to find a useful tool to do a task in Python that’s basically trivia in almost any other language) is a “string” that, when pulled, almost always ends up with me getting so frustrated I can’t help but rage about it… (Yes, the project COULD be done in a language other than Python, and I’d say it would probably be easier, since it’s likely that I’d be more skilled in that other language than I am in Python) however, that decision isn’t mine to make, so Python it is, whether I like it or don’t)

Does anyone know of a Python graphics package that fits my requirements? If so, PLEASE clue me in!

Have you considered Pillow?

Hi @Enthor First I want to offer some sincere advice for how to get the best help here: ask your questions much, much, much more simply, plainly and directly. Everyone here is volunteering their time and expertise for free, and they want to be able to understand problems and offer guidance as quickly and efficiently as possible. Additionally, there are people on this forum from all over the world. Keeping questions in plain, direct language, free from unnecessary editorializing, will make them accessible to the widest audience.

As for a possible solution? I work on Bokeh so I’ll suggest that. :person_shrugging: Here’s 50000 random points plotted in with Bokeh:

import numpy as np
from bokeh.plotting import figure, show

# data prep, including RGBA color array
x = np.random.random(size=50000) * 100
y = np.random.random(size=50000) * 100
c = np.array([(r, g, 150) for r, g in zip(50+2*x, 30+2*y)], dtype="uint8")

# drawing bits
p = figure()
p.scatter(x, y, size=4, color=c, alpha=0.6)

then after ~1 second:

That seems about as simple as it gets, personally. If you need a half million points instead of 50000, there’s a WebGL option you can turn on with one extra parameter.

But I have to mention that Bokeh is actually geared towards interactive plotting in web-browsers, so I guess that’s probably not you are looking for. However that is another issue with your post: you have not actually been very clear and explicit about your requirements at all. What do you actually need? Is this “window” part of a rich client application? Would a local web app be acceptable? Is it OK to generate static PNG or JPEG images or vector/SVG output and then display that in the window? That probably opens more options FWIW. How many points do you need to draw? There are lots of tool options because there are lots of use different cases, and that is fine. But that is also why knowing the actual details of your requirements matters, as far as guidance is concerned.