[BangPypers] Questions regarding Image cropping

Lakshman Prasad scorpion032 at gmail.com
Mon Mar 2 15:35:16 CET 2009

Gimp provides more tools to achieve different Image processing effects. It
is script-able in Python.
U may want to consider Gimp + Python:

Image.show() just calls the picture viewer in the OS. If Ur using windows, U
may want to call a function to perform "Open with"

U can also achieve similar functionality using Pygame: http://pygame.org/

On Mon, Mar 2, 2009 at 2:51 PM, Anand Balachandran Pillai <
abpillai at gmail.com> wrote:

> On Sun, Mar 1, 2009 at 1:25 PM, Arunabha Adhikari
> <arunabha.adhikari at gmail.com> wrote:
> > Dear friends,
> >
> > I am a beginner in Python programming. I am not a computer professional I
> am
> > a physicist. I was trying to write a code in python for my own research
> > which involves a little image processing. All I need to do is to display
> an
> > image and then select a region of interest using my mouse and finally
> crop
> > out the selected region. I can do this in Matlab using the ginput()
> > function. I tried using PIL. But I find that after I issue the command
> > Image.show(), the image is displayed but then the program halts there
> unless
> > I exit from the image window. Is there any way to implement what I was
> > planning. Do I need to download any other module? Please advise.
> The task of selecting an area on an image for processing
> is called "rubber-banding". The technique is to XOR the pixels
> of the selected region (rectangle). Then get the boundaries
> of the region.
> I actually wrote a complete image viewer cum editor using wxPython/PIL
> many years back. I later on published the rubberbanding part as an ASPN
> recipe. If you want to use wxPython, the recipe would be useful.
> http://code.activestate.com/recipes/189744/
> Btw, this was for an older release of wxPython, so not sure whether
> this will work now. However the algorithm is generic and can be mapped
> to any GUI library.
> The image viewer source code is here. Btw, this is really *ancient*
> and an abandoned project - I updated it last in 2003 I guess. However
> I guess many of the code there is still generically useful, especially
> the convolution filters.
> If you are feeling either brave or desperate or both, click on
> the following link.
> http://members.fortunecity.com/anandpillai/python/PyWiewSrc.zip
> Regards
> --Anand
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20090302/c87c8bce/attachment.htm>

More information about the BangPypers mailing list