![]() Registered Member ![]()
|
Hi, I'm trying to dip my toes into using Python in Krita a little. I have little idea where to even start with basics - I've found examples of how to clone layers, export them to files etc, but I can't seem to get from there to what I want to do. Does anyone have an example of what I suppose should be a fairly simple task: Copying the merged pixel data of all visible layers in a document, within a selection, to another document?
I'd appreciate any help! |
![]() KDE Developer ![]()
|
You could try to get the copy_merged action from the Krita object and trigger it. That would place the paste on the clipboard. Then in a new document, get the edit_paste action and trigger that. I haven't tried it yet, though!
|
![]() Registered Member ![]()
|
That is:
Not exactly playing with pixelData though. You could copy_merged, edit_paste or paste_layer_from_clipboard, find the layer from app.activeDocument() with app.activeDocument().topLevelNodes()[-1] or app.activeDocument().nodeByName() and those nodes have members called pixelData. This might seem like basics, but for searching through pykrita I do something like this:
|
![]() Registered Member ![]()
|
Look heres a lot of the information you need: https://forum.kde.org/viewtopic.php?f=156&t=156407&p=410512&hilit=selection#p410533
No wonder you didn't find it by yourself though, the topic has a vague title. |
Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell