opensubscriber
   Find in this group all groups
 
Unknown more information…

i : image-sig@python.org 23 October 2011 • 6:46AM -0400

Re: [Image-SIG] problem with TIF image in PIL
by Edward Cannon

REPLY TO AUTHOR
 
REPLY TO GROUP




this seems odd. My only guess is that the tostring call is not so
good. Try just calling the tostring() method without any arguments and
see what happens.


On Fri, Oct 21, 2011 at 10:42 PM, FiverChinook <hanserik14411@gmai...> wrote:
>
> I'm having a problem with opening a TIF image in PIL, rotating it, and then
> converting it to a string for use somewhere else. This is the Python code:
>
> im1 = open("c:\image.TIF")
> im2 = im1.transpose(ROTATE_90)
> im3 = im2.tostring("raw", "RGB", 0, -1)
>
> When I display the rotated image using the PIL show() function (immediately
> after the rotation is applied) it looks OK. However, when I convert the
> image to a string and display it elsewhere, it appears diagonally warped,
> although the colors are OK. If I do not rotate the image, then it looks OK
> after the "tostring" conversion. So, it seems that the
> "transpose(ROTATE_90)" function is doing something to the image that is not
> evident until it is converted to a string... I'm completely baffled.
>
> FYI - I've checked the mode of the image after opening it and it is "RGB"
>
> Thanks for the help!!
> --
> View this message in context: http://old.nabble.com/problem-with-TIF-image-in-PIL-tp32700359p32700359.html
> Sent from the Python - image-sig mailing list archive at Nabble.com.
>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG@pyth...
> http://mail.python.org/mailman/listinfo/image-sig
>
_______________________________________________
Image-SIG maillist  -  Image-SIG@pyth...
http://mail.python.org/mailman/listinfo/image-sig

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.