# Latex colours not matching when seen using opencv

I am working on a project where I need to extract each cell in a table in a latex file. So I am coloring each of the cell with different color so that when I parse the png image of the file then I should get different colour for each of the cell. But I am getting slightly different color in both the cases. My Latex code is

\documentclass{article}
\usepackage[table]{xcolor}
\begin{document}
\begin{tabular}{l}
\cellcolor[RGB]{100,150,200}
\end{tabular}
\end{document}}


When I parse the file using opencv then I get the following colors. [(255, 255, 255), (235, 224, 214), (198, 156, 115), (199, 149, 98), (18, 18, 18)] My python script is

import numpy as np
import cv2
from PIL import Image
file_name = 'rough-1.png'

• If you uncompress your PDF and open it with a text editor, the colour is 0.39215 0.58823 0.7843 rg which matches your input. So your problem must lie in how you are converting from PDF to PNG or how you are parsing the PNG, not with LaTeX. – David Purton Jun 13 '19 at 12:50