I want to compare color histograms between a digital photo and its physically printed in cloth (like a T-shirt) version. The process is simple:

  1. Printing a digital image (with good resolution) in a T-shirt
  2. Take a picture of that printed T-shirt in proper alignment and crop
  3. Compare histograms

As one might expect, the color histogram of the photo of the printed T-shirt is very different from the original image, as it should be. What I want to know is if there is any known method to achieve one of the following:

  1. From original digital image, transform colors so to be closer to printed colorspace histogram.
  2. From printed T-shirt photo, try to normalize or transform in some way to achieve back original colors.

I am aware that the color distribution of the printed T-shirt depend also on the camera that captures it. Right now I am thinking of training a ML model to try to learn the color transformation between two colors distributions (original and physically printed).

However, I wonder if there is some literature about that or some procedure I can perform using my camera to try to find that color transformation so I can apply to other prints.

My goal is to generalize (predict) the printed color distribution transformation from original digital image. As I'm always using the same printer for print, and the same camera for the photo of the T-shirt, I guess this should be feasible.

Thanks in advance.

  • 2
    \$\begingroup\$ While the idea you have, is the right one, there is already an established way to do that: you will find more about that under color-management in print. \$\endgroup\$ Commented Jul 16, 2021 at 4:22
  • \$\begingroup\$ Thanks. Can you point some more keywords of techniques related? Thanks! \$\endgroup\$ Commented Jul 16, 2021 at 4:31
  • 1
    \$\begingroup\$ Have you considered just printing one or more test patterns and measuring the transformation directly? \$\endgroup\$
    – Caleb
    Commented Jul 16, 2021 at 5:43
  • 6
    \$\begingroup\$ This looks like a standard color calibration process. Been done for decades without using ML. To get enough data for ML would cost you a lot in T-Shirts... \$\endgroup\$
    – xenoid
    Commented Jul 16, 2021 at 7:38
  • 1
    \$\begingroup\$ @PabloCarneiroElias Ah. I'm sorry you didn't get any traction over at Stats-SE. I don't think it's a matter of not being well-written; it seems written fairly well for the right context. I'm just struggling with the topicality in a photographic context. However, there's been very little objection (via vote-to-close because of being off-topic), so I'm in no rush to close it or move it. You've gotten an answer and perhaps some help, so that's good. =) \$\endgroup\$
    – scottbb
    Commented Jul 20, 2021 at 1:44

1 Answer 1


The industry standard method would use two transforms encoded as ICC profiles. The input device would use an mapping from its color characteristics to the Profile Connection Space. Likewise the output would use a mapping from the Profile Connection Space to its output color space.

This is the standard because it allowed for connecting any input device to any output device.

Going backwards from the print isn’t really possible in a direct way. You need an input device (such as a camera or scanner) to capture an image of the print. And then you are dependent on its ICC profile (or a logical equivalent) to get back into Profile Connection Space.

That is not to say you can’t do it…that’s what printer profiling hardware does.

Anyway, the way to do the sort of things you want to do is available off the shelf from companies such as Xrite and DataColor using ICC profiles. It is not cheap. But it is as cheap as it gets.

  • \$\begingroup\$ Thanks. In my case Im developing a CBIR (content based image retrieval) and I need to develop the color calibration myself as part of the product. \$\endgroup\$ Commented Jul 17, 2021 at 5:11
  • 1
    \$\begingroup\$ @PabloCarneiroElias (a->b & b->c) -> a->c. That’s why you can use ICC profiles for any arbitrary transformation. But the transformations are determined empiricaly by measure. You can’t reason precisely about how multiple inks combine on a particular physical medium. Math won’t get the right answer. Empirical results are required. \$\endgroup\$ Commented Jul 17, 2021 at 5:22
  • \$\begingroup\$ Yes, there is no way of easily understanding chemically how the medium affects light absortion/reflection. Also, the camera colorspace can indeed be modeled separated. However, since I am always using the same printer and same camera, what matters for me is the overall final result of print + camera capture. So a final colorchecker that was printed then captured and compared with original rgb values is enough to create the model for correction, like an unified model. \$\endgroup\$ Commented Jul 17, 2021 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.