Gimp で、色付きの四角形の描き方がわかりませんでした。
UIを使ったやり方は、↓こちら。
これをPythonで書くと以下の通り、
関数は以下のサイトを参照。
例:白色の四角
def set_color_background(r, g, b, a): color = (r, g, b, a) pdb.gimp_palette_set_background(color) def set_color_foreground(r, g, b, a): color = (r, g, b, a) pdb.gimp_context_set_foreground(color) def draw_pencil_lines(drawable, lines): pdb.gimp_pencil(drawable, len(lines), lines) def draw_rect(drawable, x1, y1, x2, y2): lines = [x1, y1, x2, y1, x2, y2, x1, y2, x1, y1] draw_pencil_lines(drawable, lines) set_color_foreground(255,255,255,1.0) set_color_background(255,255,255,1.0) image = create_image(500, 500) layer = add_layer(image, "背景") draw_rect(layer, 0, 0, layer.width, layer.height)
描画色、背景色を設定してから色を付けるしかないのかな。