It is currently Tue Apr 30, 2024 6:38 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Problem with pdb.gimp_drawable_set_pixel
PostPosted: Mon Oct 24, 2016 4:58 am  (#1) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Intermediate Level



Hello
who confirms this error for gimp.2.8.18 under windows 10 python console:
>>> image = gimp.image_list()[0]
>>> drawable = image.layers[0]
>>> for x in range(50):
... for y in range(50):
... pdb.gimp_drawable_set_pixel(drawable,x,y,3,(255,255,255))
...
>>>
on a totally black picture does not show a white square at all????

EDIT
I think a flush is missing and eventually a save and reopen

SOLVED so to say :yes


Last edited by PKHG on Mon Oct 24, 2016 6:19 am, edited 1 time in total.

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: Problem with pdb.gimp_drawable_set_pixel
PostPosted: Mon Oct 24, 2016 5:34 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
did you try also with ...x,y,4,(255,255,255,255)
maybe your open image is RGBA

_________________
"Where am I ?"


Top
 Post subject: Re: Problem with pdb.gimp_drawable_set_pixel
PostPosted: Mon Oct 24, 2016 10:29 am  (#3) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
dinasset wrote:
did you try also with ...x,y,4,(255,255,255,255)
maybe your open image is RGBA

No, was no RGBA ...

flush alone seemed not to help, save and open showed the pixel-manipulations ...


Top
 Post subject: Re: Problem with pdb.gimp_drawable_set_pixel
PostPosted: Mon Oct 24, 2016 11:03 am  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
A script of mine that uses pdb.gimp_drawable_set_pixel() doesn't need more than pdb.gimp_displays_flush().

_________________
Image


Top
 Post subject: Re: Problem with pdb.gimp_drawable_set_pixel
PostPosted: Mon Oct 24, 2016 11:57 am  (#5) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
you need to call this
pdb.gimp_drawable_update(drawable,0,0,drawable.width,drawable.height)

_________________
TinT


Top
 Post subject: Re: Problem with pdb.gimp_drawable_set_pixel
PostPosted: Tue Oct 25, 2016 2:24 am  (#6) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Attachment:
glab_opacity_ex01.jpg
glab_opacity_ex01.jpg [ 21.67 KiB | Viewed 1702 times ]
trandoductin wrote:
you need to call this
pdb.gimp_drawable_update(drawable,0,0,drawable.width,drawable.height)

Thanks, good to know ;)

EDIT:
used in my expanded guide-lab to fill selections with an color (either random or with color of the pixel in the center of an ellipse or rectangle)
Attachment:
glab_opacity_ex01.jpg
glab_opacity_ex01.jpg [ 21.67 KiB | Viewed 1702 times ]


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


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

3

No new posts Attachment(s) Pixel Art Help

2

No new posts Pixel art experiment

6

No new posts Attachment(s) Use Shrink or Grow by 1 pixel on command

12

No new posts GIMP's fast pixel operations

4



* Login  



Powered by phpBB3 © phpBB Group