If you want to make an editor which does this, then you may want to take a look at javascript libraries which provide such functionalities. It's a very easily pluggable module from YUI javascript library which allows you to crop with a very easy interface. Here is an example : <a href="http://developer.yahoo.com/yui/examples/imagecropper/feedback_crop.html">http://developer.yahoo.com/yui/examples/imagecropper/feedback_crop.html</a><br>
<br><br><div class="gmail_quote">On Sun, Mar 1, 2009 at 1:32 PM, Noufal Ibrahim <span dir="ltr"><<a href="mailto:noufal@gmail.com">noufal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<div class="Ih2E3d"><br>
On Sun, Mar 1, 2009 at 1:25 PM, Arunabha Adhikari<br>
<<a href="mailto:arunabha.adhikari@gmail.com">arunabha.adhikari@gmail.com</a>> wrote:<br>
> Dear friends,<br>
><br>
> I am a beginner in Python programming. I am not a computer professional I am<br>
> a physicist. I was trying to write a code in python for my own research<br>
> which involves a little image processing. All I need to do is to display an<br>
> image and then select a region of interest using my mouse and finally crop<br>
> out the selected region. I can do this in Matlab using the ginput()<br>
> function. I tried using PIL. But I find that after I issue the command<br>
> Image.show(), the image is displayed but then the program halts there unless<br>
> I exit from the image window. Is there any way to implement what I was<br>
> planning. Do I need to download any other module? Please advise.<br>
<br>
</div>If you want to do image cropping non-interactively (ie. using a script<br>
or someting) I would recommend that you use something like 'convert'<br>
that comes with the ImageMagick utilites. You can say something like<br>
convert original.jpg -crop <specificiation> output.jpg<br>
and you'll get what you want.<br>
<br>
If you want to interactively decide what piece you want to crop, I<br>
think it would be better to use a graphics editing program like the<br>
GIMP.<br>
<br>
If you're trying to implement a graphics editor in Python, I think it<br>
will be quite hard. Maybe if you can explain your requirements a<br>
little more, I might be able to help. I've used PIL a few years ago<br>
and have some memory of what it provides.<br>
<br>
Ta ta.<br>
<font color="#888888">--<br>
~noufal<br>
_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
</font></blockquote></div><br>