PIL: Get RGB Value from GIF

If you load a GIF file with PIL via‘giffile.gif’) and then try to look at its pixels, you would get integers instead of tuples since the GIF pixels refers to one of the 256 colours in the GIF colour palette. The palette would then contain the RGB value of the pixel.

To avoid all this hassle and just get RGB tuple directly:

gif ='giffile.gif')
rgbimage = GIF.convert ('RGB')
>>>(231, 10, 54)
 Scroll to top