logo-print

carol.gimp.org

GIMP 2.2

color testcharts

There was a moment in my past; a moment in which I decided to ditch continuing with college and devote this study time to my computer with an emphasis on images. This moment occured right after I figured out how to write proofs for linear algebra again -- more honestly, one good homework.

Several years later, I am playing with TheGIMP scripting and trying to understand this color stuff. You can not read any explanation of the process without some fairly advanced linear algebra in the explanation. Usually, it is at those places in the explanation where they say or write things like "a bidirectional relationship between the coordinates of ... the Profile Connection Space" and your brain blurs because you know it makes sense, but you forgot the reason why.

Me & GIMP in the Profiling Workflow

Draw this

I looked at this image and knew that I could make color charts with TheGIMP. Using the gradient editor would be easy to make color patches. Later, more math could be introduced either by changing the gradient draw or the colors inputed.

Find some of these

While I was writing the plug-in to write test charts with TheGIMP, the plan was to find icctables and CIELab tables as well as some printer or scanner look up tables to play with. As well as thinking about what colors to use. A look up table is simply a table of numbers.

PyGIMPTestchart
testchart

Making Testcharts

In the little picture of profiling in the workflow is an image that is being displayed on a monitor and being printed from a printer. I put down the textbook and pdf print outs and wrote a little plug-in that would take 4 colors and use them for the corner colors of a test chart and at the same time, produce a table of the name and number of the colors displayed in the test chart.

When I wrote this, I had no idea where the first four colors would come from or what form my final table should be in. I did know that I wanted it to display on a monitor and print as a 4x6 inch photograph or as a letter sized page.

Using the gimp's gradient editor meant that I could skip telling the plug-in how to approximate the colors and easily draw them regardless of the final image resolution. The way that I used the gradient editor in this first version makes a flawed chart in that the right most colors in the color patch are not the final color, just close. It records the correct color information in my "look up table", however.

First, I successfully created a gradient with a specific start and end color and divided this gradient into the requested number of segments. The script then runs through the gradient segments and makes each segment the same color by reading the color on the left and writing to the color on the right. It stores the color value into a list of colors that will be turned into a GIMP Palette. The script then stores this gradient by name into a list of items to be deleted, among other things.

With the ability to make the gradients, I started by getting the colors that will appear on the left side of the testchart by making a gradient from x0 to xn and I called it start_colors:

start_colors

Then I make end_colors using y0 to yn:

end_colors

The "almost" is a problem. I completed the script with the problem because at least my color patch and color table are accurately recorded, as we shall soon see.

Using these start and end colors from the gradient, I make a new gradient and draw that. TheGIMP takes care of the gradient naming and also puts this name for the group of colors in the palette.

pygrad8

pygrad9

pygrad10

pygrad11

These gradients are deleted when the script is finished.

A gimp palette of the colors used in the test chart is made and not deleted. It is a look up table of colors. I know this because I could easily write a script that defined each color contained within this palette file to be a named color in LaTeX.

pygrad-photograph

pygrad

TheGIMP stopped drawing gradients accurately after one upgrade, I spent the next several hours refining the dimensions of the testcharts and the final output. I left the color problem alone for this time also. The broken gradient writing had nothing to do with how my script worked, nor did it affect the dimensions of the patches, so I worked on this. Fixing the gimp problem was a nice look at how a simple turing machine should work. For this reason, this first version of my testchart script is called testchart-turing.py and will need to be uninstalled before the next version will work.

Finding Other Look Up Tables

Not as easy as it should be.



another-gnu-type-sm

Most all of my software is gnu. thanks!

Creative Commons License

This work is licensed under a Creative Commons License.