| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 4,788
» Latest member: mge56s
» Forum threads: 7,880
» Forum posts: 42,905
Full Statistics
|
| Latest Threads |
Working with layers - a h...
Forum: General questions
Last Post: saint_m
8 hours ago
» Replies: 4
» Views: 1,162
|
pl_hexgrid for GIMP 3 has...
Forum: Extending the GIMP
Last Post: Scallact
11 hours ago
» Replies: 0
» Views: 64
|
Mousewheel Zoom behavior
Forum: General questions
Last Post: rich2005
Yesterday, 08:18 AM
» Replies: 8
» Views: 343
|
75 Unix commands in Windo...
Forum: Watercooler
Last Post: denzjos
Yesterday, 06:59 AM
» Replies: 0
» Views: 94
|
Meaning of scissors symbo...
Forum: General questions
Last Post: rich2005
06-04-2026, 07:52 PM
» Replies: 1
» Views: 144
|
DOSBox release 4 December...
Forum: Other graphics software
Last Post: denzjos
06-03-2026, 07:56 AM
» Replies: 3
» Views: 3,785
|
question about "Batch Ima...
Forum: General questions
Last Post: rich2005
06-03-2026, 07:21 AM
» Replies: 4
» Views: 546
|
Excessive color values in...
Forum: General questions
Last Post: rich2005
06-01-2026, 08:23 AM
» Replies: 3
» Views: 343
|
back in time : C=64
Forum: Other graphics software
Last Post: denzjos
05-31-2026, 09:01 AM
» Replies: 3
» Views: 5,183
|
gimp-file-load not workin...
Forum: Scripting questions
Last Post: Alb.gimp
05-30-2026, 02:21 PM
» Replies: 0
» Views: 208
|
|
|
| script-fu help |
|
Posted by: egrivel - 03-08-2026, 07:43 PM - Forum: Extending the GIMP
- Replies (6)
|
 |
Hi, I have a script-fu script I wrote back in 2003, which I use to save the current image in the ../edited folder, and mark the image as "saved". I have been using this script in every version of Gimp since 2003 without changes, but when I tried to use it in Gimp 3.0 I got the error:
Execution error for 'DoIt':
Error: eval: unbound variable: gimp-image-get-filename
Does anybody know if the function gimp-image-get-filename has changed in Gimp 3.0, or if I'm missing something in my Gimp installation?
Thanks,
Eric
|
|
|
| Selecting more than one layer mask? |
|
Posted by: teapot - 03-07-2026, 04:09 AM - Forum: General questions
- Replies (4)
|
 |
In Gimp 3.2.0 RC3:
The tip for the cross icon at the bottom right of the layers dialog when a layer mask is selected is plural, it says: "Remove layer masks and their effect" This seems to imply that more than one layer mask can be selected but I can't see a way to do it. When using shift or ctrl to select more than one item in the layers dialog, it activates the layer and not the layer mask even when clicking on layer masks. What does the tip refer to?
|
|
|
| Gimp 3.0 - How to draw stuff with python scripts (pixel by pixel) |
|
Posted by: krokots - 03-04-2026, 05:15 PM - Forum: Scripting questions
- Replies (4)
|
 |
I need help writing some basic script that will draw, for example, a circle, or a rectangle of randomly colored pixels, at a specified X and Y on the selected layer. For now I got this :
Code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import gi
gi.require_version("Gimp", "3.0")
gi.require_version("GimpUi", "3.0")
gi.require_version("Gegl", "0.4")
from gi.repository import Gimp, GimpUi, Gegl, GObject, GLib
import sys
class DrawCirclePlugin(Gimp.PlugIn):
def do_set_i18n(self, name):
return False
def do_query_procedures(self):
return ["python-fu-draw-circle"]
def do_create_procedure(self, name):
Gegl.init(None)
procedure = Gimp.ImageProcedure.new(
self, name,
Gimp.PDBProcType.PLUGIN,
self.run,
None,
)
procedure.set_image_types("*")
procedure.set_sensitivity_mask(Gimp.ProcedureSensitivityMask.DRAWABLE)
procedure.set_menu_label("Draw Circle")
procedure.add_menu_path("<Image>/Filters/Draw")
procedure.set_documentation(
"Draw a filled/outlined circle of a chosen color and radius",
"Draws a circle centred at (center_x, center_y) with the given "
"radius, fill color, and optional stroke outline.",
name,
)
procedure.set_attribution("Your Name", "Your Name", "2024")
procedure.add_int_argument(
"center-x", "Center X", "X coordinate of the circle center (px)",
0, GLib.MAXINT, 100, GObject.ParamFlags.READWRITE,
)
procedure.add_int_argument(
"center-y", "Center Y", "Y coordinate of the circle center (px)",
0, GLib.MAXINT, 100, GObject.ParamFlags.READWRITE,
)
procedure.add_int_argument(
"radius", "Radius", "Radius of the circle in pixels",
1, GLib.MAXINT, 50, GObject.ParamFlags.READWRITE,
)
default_color = Gegl.Color.new("red")
procedure.add_color_argument(
"color", "Fill Color", "Color used to fill (and stroke) the circle",
True, default_color, GObject.ParamFlags.READWRITE,
)
procedure.add_boolean_argument(
"fill", "Fill circle", "Fill the interior of the circle",
True, GObject.ParamFlags.READWRITE,
)
procedure.add_boolean_argument(
"stroke", "Draw outline", "Stroke an outline around the circle",
False, GObject.ParamFlags.READWRITE,
)
procedure.add_int_argument(
"stroke-width", "Outline width", "Outline thickness in pixels",
1, 500, 2, GObject.ParamFlags.READWRITE,
)
return procedure
def run(self, procedure, run_mode, image, drawables, config, run_data):
Gimp.message("A")
if run_mode == Gimp.RunMode.INTERACTIVE:
GimpUi.init("draw_circle")
dialog = GimpUi.ProcedureDialog.new(procedure, config, "Draw Circle")
dialog.fill(None)
if not dialog.run():
dialog.destroy()
return procedure.new_return_values(
Gimp.PDBStatusType.CANCEL, GLib.Error()
)
dialog.destroy()
drawable = drawables[0]
image.undo_group_start()
# draw stuff here
image.undo_group_end()
return procedure.new_return_values(Gimp.PDBStatusType.SUCCESS, GLib.Error())
Gimp.main(DrawCirclePlugin.__gtype__, sys.argv)
I see that Drawable class have a method SetPixel, but in the docs it says that undo doesn't work on that. So, how to modify drawable pixels so that undo works ?
|
|
|
| Monochrome png exports as grayscale antialiased (RESOLVED) |
|
Posted by: vtgimp - 02-27-2026, 07:57 PM - Forum: General questions
- Replies (2)
|
 |
I'm presently trying to export a png file as monochrome only, but every time I do, it converts to grayscale antialiased in the saved .png.
Specifically, I save a strictly monochrome 300 dpi bitmap from MTPaint. I can view that image in any image viewer, including in GIMP itself, zoom in, and see that all of the pixels are either black or white. No grays.
In Gimp if I now export that as a png with a new name, the saved png when opened in any viewer now has antialiased greyscale pixels in curved shapes.
If I take that new image back in, and go to colors>image>threshold and again to make it monochrome, succeed at that, then save it as a png, it converts back to antialiased grayscale in the file.
I'd appreciate any advice on how I can simply save a true monochrome .png with Gimp.
Thanks in advance.
|
|
|
|