1

I would like to use graphicsmagick with wxpython to make an interactive image editor. I'm using the pgmagick python api.

A naive attempt:

from wxPython import wx
from pgmagick import Image

im = Image('portrait.png')
wximg = wx.wxEmptyImage(im.columns(), im.rows())
wximg.SetData(im)

produced: TypeError: expected a readable buffer object from wximg.SetData(im)

Then I flailed about trying pgmagick.getPixels, blob, etc. without success.

Have you succeeded?

Thanks!

CoolRoar
  • 11
  • 1
  • 2

1 Answers1

1

The wxPython library can open PNG files itself without the need for pgmagick. In fact, you can use the Python Imaging Library with wx too. I suspect that pgmagick isn't returning a buffer object (i.e. a stream) of the image. If you can achieve that, then maybe you can make it work.

Mike Driscoll
  • 32,629
  • 8
  • 45
  • 88