
I will continue to tweak and improve this script.
KRITA DUPLICATE SELECTION CODE

SelectionPL1 = processedLineSe.duplicate() #Scope for eliminating unwanted parts of the lid. ReactsToGapSe = processedLineSe.duplicate()ĮraseLineSe = processedLineSe.duplicate() ProcessedLineSe = createSelection(lineNode, transparentFilter) Pixels = bytes(pixel_ptr.asarray(teCount())) Image = QImage(w, h, QImage.Format_ARGB32) #使い方selection = createSelection(doc.activeNode(), transparentFilter)ĭef fillColor(node, colorx):#選択範囲に関係なく全面が色づく tPixelData(selectionData, x, y, width, height)ĭef transparentFilter(r, g, b, a):#不透明度の閾値を数値で決める SelectionData = bytearray(width * height)įor i, rgba in enumerate(iter_unpack('>BBBB', pixelData)): PixelData = bytes(node.projectionPixelData(x, y, width, height)) Width, height = bounds.width(), bounds.height() ndEvent(canvas, table_release)įilt = application.filter('edge detection')ĭef createSelection(node, filterFunc):#Converting an image to selection PosF = QPointF(canvas.mapFromGlobal(global_pos)) If c.metaObject().className() = 'KisCanvasController':ĭef click_canvas(global_pos=None):#click action Q_mdi_sub_window = q_mdi_area.currentSubWindow() Q_mdi_area = q_stacked_widget.currentWidget() Q_stacked_widget = q_window.centralWidget() Q_window = application.activeWindow().qwindow() (coloring is not included in the code) from struct import iter_unpack

If it works correctly, you can make the selections shown in the image above. You can try it out by setting up this script in Ten Scripts and running the script at any cursor position.
