It is currently Wed Jun 03, 2026 11:38 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Eager to learn how to draw pixel functions in GIMP python
PostPosted: Mon Jun 28, 2021 12:24 pm  (#1) 
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)


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Eager to learn how to draw pixel functions in GIMP python
PostPosted: Tue Jun 29, 2021 3:30 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
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

_________________
Image


Top
 Post subject: Re: Eager to learn how to draw pixel functions in GIMP python
PostPosted: Tue Jun 29, 2021 10:03 am  (#3) 
I understand what you're saying, thank you ofnuts. I will download them. Thanks again :coolthup


Top
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group