Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
レイヤーを選択範囲にトリミングするための GIMP API 呼び出しは何ですか? GUI の[レイヤー] -> [選択範囲にトリミング] と同等ですか?
プロシージャ ブラウザを調べましたが、見つかった呼び出し (gimp-cropおよびgimp-image-crop) は、レイヤーではなく画像に対してトリミングを実行します。
gimp-crop
gimp-image-crop
(私が本当にやりたいのは、一度に複数のレイヤーをカット アンド ペーストすることです。そのためのプラグインを作成しています。)
pdb.gimp_layer_resize()からのデータを使用して使用しますpdb.gimp_selection_bounds(image)。
pdb.gimp_layer_resize()
pdb.gimp_selection_bounds(image)
x0,y0 = pdb.gimp_drawable_offsets(layer) non_empty, x1, y1, x2, y2 = pdb.gimp_selection_bounds(image) pdb.gimp_layer_resize(layer,x2-x1,y2-y1,x0-x1,y0-y1)