Skip to content Skip to sidebar Skip to footer

Reading And Compressing A Picture With Rle

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 usef

Solution 1:

As for the second part of your question: I would highly recommend OpenCV. 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:

importcv2image= 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.

Post a Comment for "Reading And Compressing A Picture With Rle"