It is currently Mon Jul 01, 2024 4:03 am


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) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
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)

_________________
https://www.deviantart.com/pocholo17
Image


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: 4752
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) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
I understand what you're saying, thank you ofnuts. I will download them. Thanks again :coolthup

_________________
https://www.deviantart.com/pocholo17
Image


Top
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Eager to learn to input text in python script (Solved)

2

No new posts Get a mouse click or select a pixel in an image in a python plugin?

3

No new posts Attachment(s) Line/pixel size doesnot correspond with pixel resolution

3

No new posts Attachment(s) HN: Draw shape - Create paths draw shapes simultaneously and easily

31

No new posts Draw Arrows/Draw Shapes: Sorry! My download link hadn't worked.

0



* Login  



Powered by phpBB3 © phpBB Group