A page in a family book can bring together photographs that were prepared separately. Before merging them into a single file, you need to know what operation each input requires. We will build a small test file where applying the same treatment everywhere fails, even when the final file carries the requested profile. The fragments used are synthetic: no family photograph or print run served as a testbed.
Setting Out the Color Data
The ICC FAQ explains that a profile links numeric counts to a reference color space and that color management transforms encodings. Our file therefore keeps the pixel values paired with their input profile, rather than defining an image by its numbers alone.
Receive the “Pantheon of 28 Legendary Chefs” Dossier (Free A4 PDF) + 5 Audio Stories
Instant complimentary access to our illustrated gastronomic & historical dossier, plus 5 DRM-free MP3 audio chronicles.
Two specific profiles are used: Display P3, henceforth P, and sRGB, henceforth S. The first is given as the profile of our initial input; the second is chosen as the destination for the exercise. We neither guessed P from a photograph nor received S as a printer’s specification.
The input consists of five pixels, in this order: A is (180; 90; 40), B is (40; 160; 100), C is (255; 0; 0), D is (0; 255; 0), and E is (128; 128; 128). This row allows us to compare several responses in a single calculation. Its numbers are chosen arbitrarily and do not represent measurements of skin, clothing, or paper.
We run the transformation with ImageCms, whose documentation describes profile conversion and the choice of rendering intent. The calculation uses three 8-bit channels, relative colorimetric intent, and no additional flags. The input and output profiles are explicitly specified for every operation.
Assigning and Converting Produce Two Different Files
We first save the exact same fifteen numbers with P, then with S. A third save stores them with no profile. In all three files, reading the data back recovers the exact initial row. Attaching S therefore did not compute any new values for A or B.
The PNG format provides an iCCP chunk containing a compressed profile. Our check decompresses it and recovers the attached profile; the untagged file has no such chunk. We did not use the separate chunk named sRGB.
Now let us run the conversion from P to S. A becomes (193; 83; 19), and B becomes (0; 163; 94). C, D, and E keep their triplets. We save this new row with S. Thus, the files that now declare S are not all the same result: under simple assignment, A was still (180; 90; 40).
The numeric equality of C alone would not distinguish these two operations. A and B separate them within the same row. Conversely, the change in A does not prove visual degradation: we are comparing numeric counts paired with two different profiles, without measuring their appearance.
Another branch deliberately introduces an error. We take the already converted values, but declare P as the input for a new transformation to S. A then becomes (208; 74; 0), and B becomes (0; 166; 86). This is not a properly declared second operation from S to S. The mistake lies in having an output processed as if it still belonged to the starting profile.
First Assembly: Same Numbers, Two Associations
For the assembly, we keep only A and B and create two two-pixel fragments. The left fragment carries the initial values and profile P. The right fragment carries the same values, but its input profile is stipulated as S. These are not two copies where we forgot a tag: the two distinct associations are part of the case data.
Our requirement is to produce both fragments in S, then place them side by side. On the left, the transformation above yields A (193; 83; 19) and B (0; 163; 94). On the right, the S-to-S operation preserves, in this test, A (180; 90; 40) and B (40; 160; 100).
The correct row therefore has four positions: transformed A on the left, transformed B on the left, unchanged A on the right, and unchanged B on the right. The two occurrences of A no longer share the same counts in the output. That is the expected result of our request, not a discrepancy to be fixed in order to make the strip uniform.
This decision may look odd if you compare only the starting values. Both fragments contained the same sequence of six numbers. Yet the calculation did not receive the same input association: P on one side, S on the other. We followed that distinction all the way to the chosen output, instead of deciding that two identical lists must necessarily receive the same treatment.
No resizing takes place. We compute no average between fragments, no transition, and no transparency. The final strip simply holds the two left pixels followed by the two right pixels. The issue is therefore not how to blend two colors cleanly along a seam; it is how to prepare what will be placed on each side.
What a Single Global Treatment Misses
Let us try another workflow: assemble the values first, discard their two associations, and declare S for the entire strip. The S-to-S transformation then leaves both copies of A at (180; 90; 40) and both copies of B at (40; 160; 100). The right side matches expectations, but the left side never underwent the requested conversion from P.
Instead, let us choose P as the single input declaration for the strip. Converting to S yields two A’s at (193; 83; 19) and two B’s at (0; 163; 94). This time, the left side matches expectations. The right side was treated as a P input, even though our case already gave it in S.
Changing the global profile merely moved the mistreated side without fulfilling the request. The first global assumption was right on the right and wrong on the left; the second was right on the left and wrong on the right. Picking the profile of whichever file was placed first would only have favored that first fragment. The choice still had to be justified for the other.
In this uniform operation, two occurrences of the same triplet pass through the same transformation and receive the same output. Yet our target requires two different outputs for the two A’s. The global calculation no longer holds the distinction that would allow it to respond differently according to their initial association. This reasoning applies to the chosen operation, without becoming a claim that computer-based assembly is impossible in general.
Here we must distinguish two procedural changes. Applying the same transformation everywhere before or after juxtaposition does not, by that shift alone, create a new result. Our solution instead uses the two input profiles appropriate to the two regions. The difference lies in the locally requested transformations, not in some mysterious property of file order.
Second Assembly: Two Different Inputs, One Shared Target
Now let us build another case. The left fragment keeps its initial values with P. On the right, we place the derivative actually obtained by converting them to S: A (193; 83; 19), B (0; 163; 94), associated with S. This time, the two input lists are different.
The requirement remains the same: prepare each fragment in S, then join them. On the left, conversion yields (193; 83; 19) and (0; 163; 94). On the right, the S-to-S operation preserves those same results. The expected strip therefore presents two identical sequences in the chosen destination.
This equality concerns the values produced at output. It is not a measurement proving that the two input encodings corresponded to the exact same physical color. We defined the right side as a derivative of the calculation and verified what comes out of both operations. There is no need to inflate this numeric outcome into a broader claim in order to use it in the assembly.
Let us repeat the flawed workflow in which we assemble the data first and declare S for the whole strip. The left stays at its initial numbers, while the right keeps those of the derivative. The two fragments remain different in the final result. That is not the expected answer, since the treatment chosen for the left was specifically meant to produce the row already present on the right.
With P as the sole input declaration before conversion, the left side now reaches its proper values. But the right side suffers the misdeclaration examined earlier: its A becomes (208; 74; 0) and its B becomes (0; 166; 86). The workflow cannot be approved just because the left fragment is finally right. The check on the right still fails, for a different reason than in the first global workflow.
This second case makes the shift in criterion visible. In the first assembly, an output where both fragments are equal is the wrong answer. In the second, their equality is expected. A rule such as “make the images match,” or conversely always preserve their numeric differences, is therefore not enough to adjudicate the results of these two requests.
We did not change the destination profile between cases. We changed the data of the right fragment and its relationship to the left. It is that exact difference that a check must track. The four positions of the strip let us identify which region missed its intended treatment or received one that did not belong to it.
First Assembly
| Position | Triplet |
|---|---|
| 1 · left A | (193; 83; 19) |
| 2 · left B | (0; 163; 94) |
| 3 · right A | (180; 90; 40) |
| 4 · right B | (40; 160; 100) |
Second Assembly
| Position | Triplet |
|---|---|
| 1 · left A | (193; 83; 19) |
| 2 · left B | (0; 163; 94) |
| 3 · right A | (193; 83; 19) |
| 4 · right B | (0; 163; 94) |
Keeping Two Decisions Separate Until They Are Resolved
In the first case, the left decision is “transform this input from P” and the right decision is “receive this input given in S.” In the second, the decisions involve the same profiles, but the right side already holds the results of the left-side treatment. Per-fragment calculations thus produce two different expectations without arbitrarily changing the rule midway.
Our correct workflow first preserves two pairs, each consisting of the pixel samples and its profile. It computes each output toward S, then assembles those outputs. At the moment of juxtaposition, both fragments have become available under the chosen final declaration. We no longer ask the global profile to stand in for the two starting pieces of information that have just done their job.
This structure also makes it possible to pinpoint an anomaly in the test results. If the left side of the first case stayed at (180; 90; 40) while the right properly kept those same numbers, it reproduces the “all S” branch. If the right side of the second case contains (208; 74; 0), it reproduces the “all P” misdeclaration.
These observations serve as signatures within our small test file, not as a universal diagnosis for any photograph exhibiting those numbers. We know the four positions and candidate operations because we constructed them. An image received without that history could have arrived at the same values in another way. The signature distinguishes our known branches without magically recovering the original profile of an unknown document.
To fix the first faulty strip, we therefore go back to the two known inputs and their respective treatments. We do not recolor the right side to bring it closer to the left: in this first case, the output difference was meant to remain. To fix the second, we also return to the inputs, but this time the target consists of two identical fragments. The answer depends on the file established before assembly, not on a visual balance improvised afterward.
What the Example Requires, and What It Leaves Open
We deliberately constructed a procedure in which assembly discards individual profiles and keeps only a global declaration. That choice explains why the solution presented normalizes the fragments before juxtaposing them. It does not establish a universal rule forbidding the assembly of images prior to conversion.
Assembling First While Keeping a Profile Map
We now run another procedure. The four pixels are juxtaposed first with no transformation. Separately, we keep a map given by the initial layout: the first two positions belong to fragment P, and the next two to fragment S. This map comes neither from the final file nor from deduction based on the numbers; it accompanies the strip as supplementary data in our test.
The calculation then processes the first region with P as input and S as destination. It processes the second with S as both input and destination, then places both results back into the same positions. We did not ask a global profile to represent two regional profiles. The program receives both assignments from the map before saving its single output in S.
For both cases, this procedure reproduces the exact file obtained by preparing the fragments before juxtaposing them. All four positions match, as do the bytes of the two compared outputs. The order “assemble, then process” succeeds here because the assembly preserved the associations needed for regional processing, rather than replacing them with a single assumption for the entire row.
Let us also verify the map rather than assuming it is right. We swap its two profiles without moving the pixels or changing the region boundaries. The calculation now receives S for the left and P for the right. Both profiles remain available, the destination remains S, and the layout still has four positions. None of those checks, taken alone, reveals that the assignments have been inverted.
In the first case, the left now keeps A (180; 90; 40) and B (40; 160; 100), while the right receives A (193; 83; 19) and B (0; 163; 94). We recover both expected pairs of values, but on the wrong side. A check that merely verified their presence somewhere in the row would accept this wrong answer. Placement is part of the expectation.
In the second case, the left likewise stays at the initial numbers. The right yields (208; 74; 0) and (0; 166; 86), since the derivative was presented as P. This is no longer a simple swap of the two correct pairs: neither region matches its expected treatment. The inverted map formally preserves two assignments, but delivers them to the wrong inputs.
This check thus distinguishes two failures in our pipeline: discarding individual associations before choosing a global transformation, or preserving them while attaching them to the wrong regions. The successful procedure preserves both the associations and their placement. We verified this possibility on the constructed fragments; it is neither a test of page-layout software nor a guarantee for every image.
For a family book page, this file therefore supplies a precise preparation question: are the specifications belonging to each image still available at the moment its treatment must be decided? It does not prescribe a universal profile for the book, nor does it predict how a press, a paper stock, or a screen will render it. None of those objects were part of the experiment.
Testing Method
Production: Pillow 12.3.0 and LittleCMS 2.19. Documentation consulted: 13.1.0.dev0. Initial independent checks: 12.2.0 and 2.18; additional regional check: 12.3.0 and 2.19. These versions remain distinguished. The results apply to the specified profiles and parameters, with no guarantee of stability across all versions and no measurement of print fidelity on paper.
