1

I'm creating a Image viewer in Ubuntu using PyGTK.

However, I'm not completely aware of pygtk API.

I'm not able to figure out how can I use PyGTK to

  1. access click point coordinates on an Image
  2. read a pixel value.
garak
  • 4,713
  • 9
  • 39
  • 56

1 Answers1

1

I don't think you will be able to do manipulate images in the way you want with the APIs given by PyGTK.
For accessing image data, I recommend looking at the Python Imaging Library (PIL).
If you're a beginner with GTK, don't miss the tutorial of the Gnome Developer Center. There is even an example for an image viewer.
Furthermore, please keep in mind that recent applications for Ubuntu are written in GTK 3. Many many examples you find on the internet are still for PyGTK 2.x and you're not encouraged to use code from them (in case you're getting them to work).

f4lco
  • 3,728
  • 5
  • 28
  • 53
  • I was actually using "Quickly" from Ubuntu to create an Image Viewing app. I want it to run on Unity interface. I'm able to access the Image object, but I don't know how to convert it to a PIL image. – garak Jul 22 '12 at 17:11
  • 1
    I'm familiar with Quickly. Quickly is the tool to create an application - it organizes the template, gives you commands etc. But the underlying UI toolkit is GTK. Of course you can design everything in Glade, but sometimes it's still necessary to hand-code some parts. I guess, you have to do both in parallel: creating one Pixbuf for the display and reading your image with PIL for examining pixels. – f4lco Jul 22 '12 at 17:29