GIMP Chat
http://gimpchat.com/

Eager to learn how to draw pixel functions in GIMP python
http://gimpchat.com/viewtopic.php?f=9&t=19471
Page 1 of 1

Author:  Pocholo [ Mon Jun 28, 2021 12:24 pm ]
Post subject:  Eager to learn how to draw pixel functions in GIMP python

Can anybody give me a sample on how to "draw pixel, loop and end the loop" on a layer?, using :

pdb.gimp_drawable_set_pixel(drawable, x_coord, y_coord, num_channels, pixel)

Author:  ofnuts [ Tue Jun 29, 2021 3:30 am ]
Post subject:  Re: Eager to learn how to draw pixel functions in GIMP python

Don't... There is some overhead for these functions, and you have to call them several thousands times for a drawing. Even on a small image you can go for coffee while your script runs.

The "fast" interface is called "pixel regions". In one of my recent scripts, it was faster to paint a mask with a patern using a region that to use Gimp's pattern fill. Two examples of use:

My "ofn-tartan" script in https://sourceforge.net/projects/gimp-t ... s/scripts/ (see the "addmask" function)

My numpy tutorial (you don't need to use numpty of course): https://www.gimp-forum.net/Thread-Gimp-python-and-numpy

Author:  Pocholo [ Tue Jun 29, 2021 10:03 am ]
Post subject:  Re: Eager to learn how to draw pixel functions in GIMP python

I understand what you're saying, thank you ofnuts. I will download them. Thanks again :coolthup

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/