Image from Text from Image?

Well, darn. It would have been nice to have a neat image just come right out of PIL for me.

To continue from last post’s experiment – where I converted an existing picture to a string – I’m wondering what happens if I convert an image to a string and back again. Will it be the same as before?

Answer: Yes, it will be the same before, but only if the same dimensions are used. Otherwise, everything goes crazy, as might be expected.

Here, I am using this image, and converting is from a 1280 x 960px RGB picture to one that is 960 x 1280px RGB.

Original – 1280 x 960px RGB

960 x 1280px RGB

The result is pretty weird. The photograph gets horizontally collapsed into thirds and is repeated in each one of those thirds.

800 x 600px RGB

Refinery – 800×600 – CMYK

The last one is the same, but with a different color model – CMYK as opposed to RGB. The streetlights look almost floral.

Refinery – 600×400 – RGB

You get the idea.

Leave a Reply

Your email address will not be published. Required fields are marked *