Steganographic message hiding
Working with resources

In read_and_write_after_tranformation you didn't bother to close any of the image resources:


# Based on a StackOverflow answer.
im = Image.open(infile)
list_of_pixels = list(im.getdata())
im2 = Image.new(im.mode, im.size)
im2.putdata(transformation(list_of_pixels))
im2.save(outfile)



Don't believe everything you read on Stack Overflow =)

You can wrap those in a with ... as. And while at it,
im and im2 are not great names.

with Image.open(infile) as in_img:
    list_of_pixels = list(in_img.getdata())
    with Image.new(in_img.mode, in_img.size) as out_img:
        out_img.putdata(transformation(list_of_pixels))
        out_img.save(outfile)


Usability

This is a nice script.
It would be great to make it more usable, 
with command line parameters:


hide sub-command: message to hide, input file, output file
show sub-command: file


You probably already know this, but argparse would be a good tool for this job.