color-space

How do you convert ProPhoto RGB colorspace to RGB with scikit-image and/or PIL?

How do you convert ProPhoto RGB colorspace to RGB with scikit-image and/or PIL? Question: I have TIF files that are in the ProPhoto RGB colorspace. These are imported fine with scikit-image’s "imload" method. However, when I try to use matplotlib to view the image data I receive the error: plt.imshow(myImage) plt.show() Clipping input data to …

Total answers: 2

Color Correction Matrix in LAB Color Space – OpenCV

Color Correction Matrix in LAB Color Space – OpenCV Question: Suppose we have l,a,b values for 5 circles inside an image. These values are calculated using OpenCV. imlab=cv2.cvtColor(circle_img_only,cv2.COLOR_BGR2LAB).astype(“float32”) Actually, we take 100 random pixels from every circle and calculate normal average LAB value for every circle (Which I am not sure it is the right …

Total answers: 1

Converting RGB to HLS and back

Converting RGB to HLS and back Question: I’m using python’s colorsys library to convert RGB color values to HLS. Just to verify, I tried converting back to RGB and got a different value back. I can understand minor differences because of precision issues, but these values are significantly different. Here’s my code: import colorsys r=192 …

Total answers: 1

Convert an image RGB->Lab with python

Convert an image RGB->Lab with python Question: What is the preferred way of doing the conversion using PIL/Numpy/SciPy today? Asked By: Antony Hatchkins || Source Answers: Edit: Sample pyCMS code: from PIL import Image import pyCMS im = Image.open(…) im2 = pyCMS.profileToProfile(im, pyCMS.createProfile(“sRGB”), pyCMS.createProfile(“LAB”)) Edit: Pillow, the PIL fork, seems to have pyCMS built in. …

Total answers: 5