Reading and Compressing a picture with RLE
Question: Currently I am learning python and I'd like to get a little bit more into Data
Compression. So I decided to try to code Run-Length Encoding(RLE).

From what I've read it can be useful when you try to compress pictures.

I would like to know what would be the easiest image-file-type for a beginner?
How can I read out pixel RGB values or similar from a picture with python?


Answer: As for the second part of your question: I would highly recommend
[OpenCV](http://docs.opencv.org/trunk/doc/py_tutorials/py_imgproc/py_table_of_contents_imgproc/py_table_of_contents_imgproc.html#py-
table-of-content-imgproc). It is very power for image processing and analysis.
A very basic example of getting the pixel values of an image in Python using
OpenCV:

    
    
    import cv2
    
    image = cv2.imread("some_image.jpg")
    image[x, y, z]
    

This will return the value of the pixel at `x, y, z` coordinates. Note that
indexing begins at 0 so if you want to access the third RGB component, you
have to do `image[x, y, 2]` where `x` and `y` are the line and column.

