Pen stops drawing after 32766 pixels

Greetings. The title of the post says it all. Here is an example:

(var image;

image = Image.color(40000, 40000, Color.new(0.9, 0.9, 0.9, 1));
image.draw({
	
	Pen.fillColor = Color.black;
	Pen.addRect(Rect(1000, 32000, 3000, 3000));
	Pen.fill;
});
image.plot
)

Any help will be much appreciated. This took a while to hunt down the problem.

I should add that it is in both directions

Sorry. I also meant to add that I am on Arch Linux. Hope that helps.

I don’t really know what your trying to achieve.

Do you come from the future ? I only have 1920 * 1080 pixels on my screen.

As expected, this saturated my RAM, I had to reboot :grinning: .

I think this is related to QT more than SuperCollider, see this thread that might be similar : Pen.addRect and Pen.addOval very slow .

I don’t think that QT was designed to work with those huge dimensions. That’s a lot of pixels. Subdividing / reducing the image, depending on your needs, might help.

I am generating an Image to export and print at high resolution. My ram does not get saturated. It just stops drawing.

Here is the first result of the google search “QT max pixel size” :

Thanks. That is a bummer. I will need to figure out a workaround…

That is strange that the background is still being drawn…

I think the QT limitation does not apply to other ‘real’ image manipulation software, like gimp, photoshop, or equivalents. I think that instead of creating a big image, you should subdivide it into 4, write them to disk, then call the external software to get them back together into a single file.

I think I would use ImageMagick to do that, because it’s ‘easy’ to use in command line.

Indeed. Unfortunately, that is not so easy the way I have implemented things…

This is only a limitation pre Qt 6 I think: qimage_p.h source code [qtbase/src/gui/image/qimage_p.h] - Codebrowser

Is it possible to compile sclang with qt6?

I doubt it. Two developers have started working on it, so it’s on the track, but still to come.

Here is where I was tracking it: General support ticket for Qt 6 · Issue #5169 · supercollider/supercollider · GitHub. I had a branch working with the 6.0 release candidate here: GitHub - mossheim/supercollider at topic/qt6

Since 2021 I no longer work on the project, it doesn’t seem anyone has made taken it up since then.

My bad Mossheim, didn’t see you worked on this before : Qt6 support · GitHub

dyfer and jrsurge have started working on this again : Comparing develop...topic/qt6-06 · supercollider/supercollider · GitHub

edit: They seem to follow what you proposed, no ?

As a note : I use QT extensively, and I’d like to participate in the implementation. But this kind of development is new to me, and I feel lost about what to do/where to begin. If you have any advice about this, do not hesitate to send me a PM.

Oh great :slight_smile:

If you have any advice about this, do not hesitate to MP me.

Nothing beyond what I already wrote in that ticket ^^