[18:24:56] <tremalo> Sweet, I got some transform working.
[18:25:06] <tremalo> I have another question, more about profiles in general though.
[18:25:36] <tremalo> My goal right now is to transform N images into a common profile so that when they are stitched together in a collage they all look like their originals.
[18:26:34] <tremalo> I know there is a lot of variability in color and color rendering… not even sure if it would work. My first attempt does indeed change the color of the output image but it still doesn’t match the original.
[18:29:34] <wiredfool> I'm not entirely sure that is going to work
[18:31:20] <tremalo> right now I’m just doing something like this: https://gist.github.com/xealot/d6bf8730e525ed65a0ae
[18:31:29] <wiredfool> so, if you've got a source image with a device specific color profile, and you change it to sRGB (frex), you should get an approximation of the original image mapped into the sRGB color space in a way that if you were to put it on different sRGB devices, you should get similar results
[18:31:42] <wiredfool> they're going to be different from the original, but consistent
[18:32:23] <wiredfool> where device specific color profile is really anything other than sRGB
[18:33:21] <tremalo> I read somewhere that sRGB is sort of the go to profile for use on the web anyway, so I thought maybe converting images to that before manipulation would have a better result. It just seems odd that even on the same device the translation is an approximation.
[18:46:07] <tremalo> I would be fine translating it into another common profile… or something.
[18:46:59] <wiredfool> sRGB is a least common denominator, so it's smaller than most other color spaces. Widely supported, but not very good. But happens to be pretty compatible with things like photoprinters and web browsers
[18:47:34] <wiredfool> so, what I'd do is load one of these into PS, and convert to sRGB. Check to see if the output is similar
[18:51:21] <tremalo> But if the image is already using sRGB the transform should look the same right?
[18:53:05] <wiredfool> it should, or at least, it should be very similar
[18:54:57] <tremalo> Hrm, my current code tries to convert the embedded profile to sRGB. When I told PS to go ahead and strip the profile the image preview is exactly the same coloring as the “converted” image that I use Python to create.
[19:19:32] <wiredfool> The transform modifies the image, and stores it with the new profile and the new pixels. When the display program reads that, it takes that profile and interprets the pixels accordingly and displays them.
[19:19:55] <wiredfool> if there's no profile, then it's just the standard linear 0-255, splat stuff up.
[19:20:12] <wiredfool> (or, if the profile is being ignored, or not understood)
[19:21:05] <tremalo> I just checked the input and output images, same color profile name and same “chromaticity” values.
[19:21:18] <wiredfool> but when you investigate the image data, looking at the bytes or the pixel values, that's generally going to be just the raw data, the profile is going to sit on top of that and interpret it for the display.
[19:21:47] <wiredfool> I'm goign to go with option 2 then, something is broken
[19:22:12] <tremalo> The transform isn’t accurate? Or am I doing something stupid?
[19:36:17] <tremalo> I would agree with you, I’m sure the color profile and color management suite is far less tested and used. I’ve been using PIL (and pillow) now for going on 7-8 years probably and am just starting to try to “do it right” with color profiles.
[19:39:04] <tremalo> If I someone who knows almost nothing about color profiles and image maths could be useful I would be happy to help! For now I’ll just step around this little issue as best I can.
[19:39:57] <wiredfool> do what you can, I'll help where I can. I hang out here, and on github
[19:40:27] <tremalo> Thanks for the time, I appreciate the effort.
[19:40:37] <wiredfool> iif you get it to a test case, that is a great start
[19:40:56] <tremalo> I can produce a test case with a test image for you if that’s what it takes.