_ebDev scripts usage and developer notes

Generated 2025-04-13 12:54:08 PM

This is documentation on the scripts and related information in the _ebDev repository. This document is made on a hobby basis and may have errors, but I try to make it stylistically consistent, complete, and accurate.

The major sections of this document are:

I use the term "scripts" more broadly than its actual meaning. While the great majority of files in this repository are computer scripts to be run via language interpreters such as Processing, Python, bash, not all of them are. Some are technical or configuration resources, notes etc., and documentation comments may be collated from those as well.

This document is available in these formats: Markdown - HTML - Open Document Text - PDF - Word

How this document is made

See the USAGE comments in makeDocumentation.sh for details, but in summary, it collates and parses documentation from comments in scripts, and combines that with a header and footer document into this larger document.

This is for convenience, but if you find a discrepancy between described behavior from anything collated here and actual script behavior, consult the documentation comments in a script itself. It may be that this document hasn't been updated after a script was updated, as the repository can be in high flux. To quickly locate and open a script, I usually use the Everything Search Engine on Windows (with a hotkey set to open the search window from anywhere) or CMD+P (file finder) in the Atom text editor on Mac, then open it for editing. (For Windows I assocaite script file extensions with a text editor so that double clicking it opens it to edit.) Also, if you don't find documentation for a script here, the script may be newer than the last time this document was regenerated.

Presentation format of documentation

Documentation for any script is presented after a header which gives the path to the script relative to the /scripts subdirectory.

Also, scripts may be listed in this ordering or rank:

The result may be a hybrid rank of what type of script I find most interesting and/or most recently modified.

Also, collated documentation comments may refer you to functional code below the comments, but that code is not copied into this document (only documentation comments are). You must find and open the source code files themselves to look at the functional source code.

COLLATED DOCUMENTATION

processing/rnd_walk_primary_shapes/rnd_walk_primary_shapes.pde

DESCRIPTION

Random walk with drawn primary shapes (with outlines) of colors randomly chosen from palette. Evolved from rnd_walk_draw_square.pde

USAGE

Open this file in the Processing IDE (or anything else that can run a Processing file), and run it with the triangle "Play" button.

processing/rnd_irregular_geometry/rnd_irregular_geometry.pde

DESCRIPTION

Rapidly generates and saves random irregular geometry ideas.

USAGE

processing/corrected_rnd_irregular_geometry/corrected_rnd_irregular_geometry.pde

processing/colorsFrom_ebPaletteAPI/colorsFrom_ebPaletteAPI.pde

processing/vogel_spiral_dots_animated/vogel_spiral_dots_animated.pde

DESCRIPTION

Generates points of a Vogel spiral (Fibonacci spiral variant), and animates attributes of the dot (what is animated may vary with different versions of this script that I might make, and different parameters I may give it).

DEPENDENCIES

dawesome toolkit (Processing library)

USAGE

Install Processing, open this file in the Processing editor or a Processing script runner, and run the script.

processing/small_and_simple_things/small_and_simple_things.pde

DESCRIPTION

"By Small and Simple Things"
Generates an animated grid of playfully colored concentric nested circles and/or n-gons which change on user click/drag. See USAGE for details and functionality.

Pretty closely imitates art by Daniel Bartholomew, but with random generative constraints: https://www.abstractoons.com/2017/05/03/by-small-and-simple-things/

USAGE

NOTES

ON INSTALLATION, if you intend to tweet, you must copy twitterAPIauth.txt (from one folder up) into the /data subfolder, and decrypt it so it actually gives the API auth, uh, thingies.

processing/rnd_walk_draw_square/rnd_walk_draw_square.pde

DESCRIPTION

Random walk of drawn squares with heavy outline and fills of random colors. Heavily modified from Random Walker example, "The Nature of Code," by Daniel Shiffman, http://natureofcode.com

USAGE

Open this file in the Processing IDE (or anything else that can run a Processing file), and run it with the triangle "Play" button.

processing/rnd_rugged_mountain_line/rnd_rugged_mountain_line.pde

DESCRIPTION

Renders a random rugged mountain line of varying slopes.

USAGE

processing/rnd_mountain_line/rnd_mountain_line.pde

DESCRIPTION

Renders a random jagged mountain line of 45 or 135 deg. slopes only.

USAGE

processing/rnd_curve_vertex/rnd_curve_vertex.pde

DESCRIPTION

Rapidly generates ideas for random squiggle lines, which are random coordinates connected by curves. May be useful as an art idea brainstorming tool when I add image/svg save functionality, which I plan to do. Interesting just to watch though.

USAGE

Open this file in the Processing IDE (or anything else that can run a Processing file), and run it with the triangle "Play" button.

processing/randomNsetChars/randomNsetChars.pde

DESCRIPTION

Prints variants of constructed random character sets (hard-coded but hackable: block characters), one complete constructed screen of them after another, with character color morph (randomization).

USAGE

KNOWN ISSUES

If you hack this to display thousands of frames per variation, it slows down.

DEPENDENCIES

Babel Stone True Type Font from: https://www.babelstone.co.uk/Fonts/Shapes.html
or my copy of it from:
http://earthbound.io/data/dist/BabelStoneShapes.ttf

also to toy with:
http://earthbound.io/data/dist/bitBlocks.ttf

processing/glyph_combinatronics/glyph_combinatronics.pde

DESCRIPTION

This is in development and not necessarily to my liking yet. The functionality may vary from this description in development or even finally. Displays 4 glyphs from a set of 16, in a 4-tile, in a sequence all possible combinations of the tiles, repetition allowed, each tile rotating in 90 degree increments. 4 tiles * 4 rotations each = 16 possible tile views, 16 views pick 4 all possible combos allow repeat = 65535 4-tile views.

USAGE

Open this file in the Processing IDE (or anything else that can run a Processing file), and run it with the triangle "Play" button.

processing/color_permutations_on_field/color_permutations_on_field.pde

DESCRIPTION

This is in development and not useful yet.
Creates color observation fields of all possible permutations of a list of colors (choosing 3 colors from the list), after a field model diagram I found for the CIECAM02 color observation model. At this writing, it renders all of them very rapidly and quits; it will be useful when it saves svgs and/or pngs of them.

USAGE

processing/colorInterpolate/colorInterpolate.pde

DESCRIPTION

Prints interpolation values, and displays color swatches for, colors interpolated at start color 'from' to end color 'to', in N steps, using Processing's built-in lerpColor function. Hack the GLOBAL VARIABLES (see that comment) to change what is interpolated. Image size depends on how many colors you hard-code. For hacking/finding color gradients.

USAGE

Open this file in the Processing IDE (or anything else that can run a Processing file), edit the assignments to the "from" and "to" variables to colors of your choosing, and run it with the triangle "Play" button.
NOTES:

processing/cellular_scribbles/cellular_scribbles.pde

DESCRIPTION

This is in development, and not necessarily to my liking yet. Draws random straight lines connecting clusters of vertices in randomly arranged cells.

USAGE

Open this file in the Processing IDE (or anything else that can run a Processing file), and run it with the triangle "Play" button.

processing/DetectLineIntersection/DetectLineIntersection/DetectLineIntersection.pde

DESCRIPTION

Interactive demonstration of detection of whether lines intersect. Tweaked from:
http://www.jeffreythompson.org/collision-detection/line-line.php

USAGE

Run the sketch. Move the mouse to move the end of the 2nd line so that it crosses or does not cross the first line, and see what happens.

processing/ArrayListsOfListsOfCombinations/ArrayListsOfListsOfCombinations.pde

DESCRIPTION

Function that creates an ArrayList of ArrayLists of all possible combinations of something (this example uses ints, but you can use anything that a one-dimensional ArrayList can contain).

USAGE

Copy and paste and adapt the code for your purposes. See more detailed documentation after the CODE comment.

imgAndVideo/mixTwoColorsSpectral.py

DESCRIPTION

Interpolates ("mixes") in -n steps between a start -s color and end -e
color using Kubelka-Munk spectral (pigment) mixing theory, via mixbox.
Prints the original and the in-between (augmented) color results to
stdout as sRGB hex color codes like #ff0596.

DEPENDENCIES

Python (probably Python 3), with the coloraide library installed:
https://facelessuser.github.io/coloraide/

USAGE

See help information with this command:

interpolateTwoSRGBColors_coloraide.py --help  

imgAndVideo/RGBhexColorSortInCIECAM02.py

DESCRIPTION

Takes a list of RGB colors expressed in hex (one per line) and sorts them
using an advanced color appearance model: CIECAM02 / JCh.
If you're sorting very different colors, YOU MAY WISH to use
sortSRGBhexColorsColoraide.py sorting in cam16 or various other color spaces instead (see). This uses the colorspacious library; that uses coloraide. rgbHexColorSortInOkLab.js may be blazing fast if you prefer oklab space (which coloraide can also use).

DEPENDENCIES

Python (probably Python 3.5), various python packages (see import list at start of code) which you may install with easy_install or pip.

USAGE

Run this script through a Python interpreter, with these positional parameters:

Example run with only a hexplt file given:

python /path/to_this_script/RGBhexColorSortInCIECAM02.py PrismacolorMarkers.hexplt  

The result will be printed to stdout, so that you may for example redirect the output to a new .hexplt file, e.g.:

python /path/to_this_script/RGBhexColorSortInCIECAM02.py inputColors.hexplt > result.hexplt  

Example run with the optional second parameter, which will cause the script to overwrite the original .hexplt file with the sorted version of it:

python /path/to_this_script/RGBhexColorSortInCIECAM02.py inputColors.hexplt foo  

Example run with the optional third parameter, an arbitrary color to start comparisons with (here, magenta):

python /path/to_this_script/RGBhexColorSortInCIECAM02.py inputColors.hexplt foo #ff00ff  

NOTES

imgAndVideo/sortSRGBhexColorsColoraide.py

DESCRIPTION

Sorts sRGB hex colors in an input file by next nearest color within the palette, starting on either the first color in the palette (default) or any optional, arbtirary color. Sorting is done by default in HCT color space; other color spaces available (see URL in USAGE). Prints by default to stdout, can optionally overwrite source file with new sort. See USAGE for examples and additional options.

DEPENDENCIES

Python with coloraide_extras library installed (which I believe in turn installs coloraide as a dependency)

USAGE

Run from python with the full name of this script and these parameters:

EXAMPLES

All invocations of this script should be in this form:

python /path/to/thisScript/sortSRGBHexColorsColoraide.py <switch flags and values>  

-- but the examples only give the last part of that, for brevity:
As one example, to sort a palette file named colors.hexplt in the default color space, and print the result to stdout, run:

sortSRGBHexColorsColoraide.py -i colors.hexplt  

To sort that starting on the color black (whether that color is in the palette or not), run:

sortSRGBHexColorsColoraide.py --inputfile colors.hexplt --startcolor 000000  

To sort that starting on the color black (whether that color is in the palette or not), and sort in oklab color space, run:

sortSRGBhexColorsColoraide.py -i colors.hexplt -s 000000 -c ok  

To do the same but sort on the default color (the first in the source file), omit the -s switch, so run:

sortSRGBhexColorsColoraide.py -i colors.hexplt -c ok  

To keep any duplicate colors, use -k:

sortSRGBhexColorsColoraide.py -i colors.hexplt -k  

To record the result to a new file, redirect stdout:

sortSRGBhexColorsColoraide.py -i colors.hexplt -k > output.hexplt  

To do the same thing only overwrite the original file, run:

sortSRGBhexColorsColoraide.py -i colors.hexplt -k -w  

imgAndVideo/print_color_wheel_steps.py

DESCRIPTION

Prints RGB hex code values (in format #dddddd) for colors in hue steps of N, from 0 to 360. N is hard-coded to 16; the color space used is hard-coded to HCT. Hack the script to change those.

USAGE

NOTES

--BUT WITH COLORAIDE, they are: h 0

re: https://facelessuser.github.io/coloraide/colors/hct/
That's also the case with colorjs, re: https://apps.colorjs.io/picker/hct

imgAndVideo/paletteCompareColoraide.py

DESCRIPTION

Compares two palettes (.hexplt format) and prints a dissimilarity ranking float between 0 and 1, where 0 means perceptually nearest or identical, and 1 means most different. 1 means 100 percent (and at best it will be expressed as something like 1.00041..). You can test this by comparing a palette of only white with only black, which is how I got that example value. SEE ALSO paletteCompareCIECAM02.py, though the default HCT space this script uses may be preferred.

USAGE

Run this script through a Python interpreter, with these parameters:

Example that will result in a print of a dissimilarity ranking (a float of 0 or higher) for two palettes:

python /path/to_this_script/paletteCompareColoraide.py --firstpalette 4_ySswfpA7.hexplt --secondpalette 6_XSj3UPW8.hexplt  

NOTES

KNOWN WEIRDNESS

Probably not an issue, as the differences still have a scale, it's just the scale may not be known: different color spaces can produce radically different maximum ranges. In the case of HCT for example it seems to work out that the max range of color comparisons is numeric 100 (with trailing decimals) for 100 percent. But for example okHSL seems to give a float between 0 and 1 to express percent. Both cases are probably valid for showing amount of difference, again, just at difference scales.

imgAndVideo/paletteCompareCIECAM02.py

DESCRIPTION

SEE ALSO paletteCompareColoraide.py, PREFERRED, as it uses a color space by default that may be better for comparison. This script (paletteCompareCIECAM02.py) compares two palettes (.hexplt format, from parameter 1 and 2) and prints a dissimilarity ranking float between 0 and 1 (zero and one hundred percent). A ranking of lower to zero means perceptually nearer or identical, and higher to 1 (100 percent) means perceptually disimmilar to totally different (perhaps opposite).

USAGE

Run this script through a Python interpreter, with these parameters:

Example that will result in a print of a dissimilarity ranking percent (a float between 0 and 1) for two palettes:

python /path/to_this_script/paletteCompareCIECAM02.py FD613A_F9C956_BAB25B_3D9676_1F463E.hexplt FE6737_F8D845_9DC17E_489B73_375557.hexplt  

NOTES

imgAndVideo/interpolateTwoSRGBColors_coloraide.py

DESCRIPTION

Interpolates in -n steps between a start -s color and end -e
color in color space -c (default HCT as 'hct'). Prints the original and
the in-between (augmented) color results to stdout as sRGB hex color codes
like #ff0596.

DEPENDENCIES

Python (probably Python 3), with the coloraide library installed:
https://facelessuser.github.io/coloraide/

USAGE

See help information with this command:

interpolateTwoSRGBColors_coloraide.py --help  

reduceListByUniqueElementsToCountN.py

DESCRIPTION

Reduce a list of elements with duplicates proportionally per unique element to count N, keeping all elements. An intended purpose is reducing .hexplt pallete files with duplicate colors while maintaining some duplicate colors (for example as placehol. In more detail: takes an input file of a flat list of unique elements with some duplicates, of length M, and reduces it to (lesser) length N by removing from adjacent duplicate elements, one per group of unique elements, iteratively until it is of length N.ders to later interpolate between the start duplicate color and the next color change N spaces away).

USAGE

Run with these parameters:

For example, given an input file named input.txt with these contents, which is 13 elements:

a  
a  
b  
b  
b  
b  
c  
c  
c  

Call this script with these parameters:

reduceListByUniqueElementsToCountN.py -i input.txt -r 6  

-- and it will print this reduction of the file, to 8 elements, to stdout:

a  
b  
b  
b  
c  
c  

NOTES

To capture the output to a new file, you can use the redirect operator e.g.

reduceListByUniqueElementsToCountN.py -i input.txt -r 6 > output.txt  

-- and the total count of all those elements is 6, so it stops. If we passed it -r 4, it would end up with this:

a  
b  
b  
c  

-- and -r 3 would end up with just a, b and c. You can use much larger and more complex source lists; the simpler list is given here for illustration purposes.
This list provides return codes for errors. See the comment after CODE.

randomNsetCharsAlt.py

DESCRIPTION

Prints random characters from a random character set A, then B, then A.

DEPENDENCIES

Python 3.8 (or maybe any 3.x version) with random and time modules installed. Moreover, python may need to be compiled with UCS2 or UCS4 support (larger text code pages support).

USAGE

Run from a python interpreter:

python /path/to_this_script/randomNsetCharsAlt.py  

imgAndVideo/printPaletteDuplicateColorsInterpolated.py

DESCRIPTION

Prints a modification of a palette where adjacent duplicates are changed to a gradient to the next different color. Takes an input .hexplt palette file and modifies it such that any adjacent duplicate colors in it are changed to interpolate from the first duplicate of the color until the next changed color, at N interpolation steps, where N is the number of adjacent duplicates. Interpolation is done with an external script which may be overridden.

DEPENDENCIES

interpolateTwoSRGBColors_coloraide.py or any alternate interpolation script which you may provide as a parameter. See USAGE.

USAGE

See help print from calling this script with no parameters.

NOTES

-- or call this script from another script and capture the output.

This code is a collaboration between a human and a large-language model tuned to "know" things about code and a lot of things. Changes for final use were by me and I don't know how the details work. Source at chatGPT: https://chatgpt.com/share/82b84cb6-28bf-45b5-bac1-fc0e72e3bd10

imgAndVideo/RGBhexColorSortToDarksAndLightsInCIECAM02.py

DESCRIPTION

Takes a list of RGB colors expressed in hex (one per line) and sorts them using an advanced color appearance model: CIECAM02, sorting into lists of darks and lights (nearest to black and nearest to white), via the colorspacious library. Adapted from RGBhexColorSortInCIECAM02.py.

USAGE

From a directory with a .hexplt file, run this script through a Python interpreter, with a .hexplt list as the first (and only) parameter to the script; for example:

python /path/to_this_script/RGBhexColorSortToDarksAndLightsIn2CIECAM02.py inputColors.hexplt  

It will print the results to new files named darks.hexplt and lights.hexplt. You may sort those results by next nearest color via e.g. RGBhexColorSortInCIECAM02.py.

NOTES

recipes/color_growth_clip_tests.py

DESCRIPTION

Tests all possible --GROWTH_CLIP rates of color_growth.py, by running it repeatedly, saving .cgp presets for each of the same.

USAGE

Run this script through a Python interpreter, without any parameters:

python /path/to/this/script/color_growth_clip_tests.py  

NOTE

This assumes that color_growth.py is in your PATH, and searches for it (which can cause a delay at the start). If you're in a hurry, hard-code the pathToColorGrowthPy variable to the correct path, and comment out the path search code.

randomNsetChars.py

DESCRIPTION

Prints N variants of constructed random character sets (hard-coded but hackable: block
characters), at X characters across and Y lines down each. Prints to either terminal or
files; hack the global variable SAVE_TO_RND_FILENAMES to alter that; hack the other globals
also for whatever other purposes you might have.
SEE ALSO randomNSetChars.pde.

DEPENDENCIES

Python 3.8 (or maybe any 3.x version) with random and time modules installed. Moreover, python may need to be compiled with UCS2 or UCS4 support (larger text code pages support).

USAGE

Run from a python interpreter:

python /path/to_this_script/randomNsetChars.py  

To pipe what is printed to a file, run for example:

python /path/to_this_script/randomNsetChars.py > 1000000_randomNsetCharsVariants.txt  

NOTES

pyenv-idle.py

DESCRIPTION

Launches python IDLE via idlelib.

USAGE

Run through a Python interpreter without any parameter to the script:

python /path/to_this_script/pyenv-idle.py  

Or, depending on your system setup and if this script is in your PATH, you may be able to run it with just:

pyenv-idle.py  

processing/glyph_combinatronics/data/helper_all_16_permutations.py

DESCRIPTION

writes all possible combinations of four base-16 digits (allowing repetition of digits) to all16products.txt.

USAGE

Run this script through a Python interpreter withuot any parameters:

python /path/to_this_script/helper_all_16_permutations.py  

printPythonVersionDetails.py

DESCRIPTION

Prints detailed python platform/version information.

USAGE

Run from a Python interpeter without any parameters to the script:

python /path/to/this/script/printPythonVersionDetails.py  

imgAndVideo/reduceIMGsimilarAssistant.py

DESCRIPTION

Takes a list of images presuably sorted by next most similar (IMGlistByMostSimilar.txt, which can be generated by the script imgsGetSimilar.sh), and presents an image viewer to navigate over the images in the order they are listed, and optionally discard any unwanted images in the sequence into a _discards subfolder.

SOURCE

This code of this script was written almost entirely by an AI in collaboration with a human (yours truly), with breathtaking exactness of what was requested (minus a few minor quickly fixed oversights). The conversation that developed it is at: https://chat.openai.com/share/095b6108-aa38-4687-9521-0b19773625af

DEPENDENCIES

Python with the tkinter library installed, a populated image file list IMGlistByMostSimilar.txt (or other file name; see comments of imgsGetSimilar.sh), and image files in that list in the same directory also.

USAGE

Call this script from python, with these parameters to Python and the script:

For example, to run this script without specifying the file name of the list of image comparisons, and use the default IMGlistByMostSimilar.txt:

python /path/to/reduceIMGsimilarAssistant.py  

Or if your comparison list file is named imageSorting01.txt, run:

python /path/to/reduceIMGsimilarAssistant.py imageSorting01.txt  

On launch, the script displays the first image in the list, with buttons to advance forward and backward through the list of images or delete them. Use the left arrow key or 'Back' button to navigate up (back) in the list, or the right arrow key or 'Forward' button to navigate forward in the list, and the 'Delete' key or button to move a viewed image into a _discards subfolder.

imgAndVideo/palette_combinatronics.py

DESCRIPTION

Creates all possible combinatations of colors of subset size N from an RGB hex palette file (.hexplt format), and writes them to a subfolder and files named after: the palette, the size of the subset (N), and the number for the combination in the sequence of all possible combinations.

DEPENDENCIES

Python 3 with itertools module installed.

WARNING

This script overwrites any target files that already exist without warning.

USAGE

Run this script through a python interpreter, with these parameters:

For example, to calculate and write all possible 3-combinations from the file RAHfavoriteColorsHex.hexplt, run:

python path/to_this/palette_combinations.py RAHfavoriteColorsHex.hexplt 3  

NOTES

imgAndVideo/padImage.py

imgAndVideo/img2RGBhexList.py

DESCRIPTION

Samples every pixel in an image, and dumps a list of all sRGB colors therefrom, in hex format.

USAGE

Run this script through a Python interpreter, with the image file name as the first parameter to this script. Example:

python path/to_this/img2RGBhexList.py input_image.png  

To pipe the output to a file:

python path/to_this/img2RGBhexList.py input_image.png > input_image_hex_colors_list.hexplt  

To reduce that to unique colors:

sort tmp.hexplt > tmp_garblethax.txt && uniq tmp_garblethax.txt > tmp.hexplt && rm ./tmp_garblethax.txt  

imgAndVideo/get_simple_RGB_gamut.py

DESCRIPTION

See scripts with 'get', 'gamut', and '.py' in their file names. This is adapted for RGB, and the output is horrible and garish, as is RGB math.

USAGE

Run through a Python interpreter without any parameters:

python path/to/this_script/get_simple_RGB_gamut.py  

imgAndVideo/get_simple_LCH_gamut_as_RGB.py

DESCRIPTION

Creates a list of colors expressed as RGB hexadecimal values, from a simplified LCH (a.k.a. HCL) gamut. Capture the list with the > operator via terminal (see USAGE). Can be hacked to do this with several gamuts which the supporting "spectra" python library can use. To change the step over various components in the gamut, hack the A_domain, B_domain and C_domain variables in this script.

DEPENDENCIES

Python 3, spectra

USAGE

Run through a python interpreter without any parameter:

python /path/to_this_script/get_simple_gamut.py  

To pipe the result to a file, do this:

python /path/to_this_script/get_simple_gamut.py > HSL_simplified_gamut.hexplt  

imgAndVideo/get_img_RND_CCC_for_color_growth.py

DESCRIPTION

Loads an arbitrary image file (sys.argv[1]) and gets random pixel coordinates with pixel colors, and constructs a parameter switch name and string of them (and other needed switches and their values) to pass to color_growth.py. (using --CUSTOM_COORDS_AND_COLORS) Prints this to stdout. May be captured by other scripts to be further used (e.g. to actually pass to color_growth.py).

USAGE

I recommend that you call this from the script call_get_rnd_CCC_for_color_growth-py.sh (SEE). Run this script through a Python interpreter, with these positional parameters:

Example run:

python /path/to_this_script/get_rnd_CCC_for_color_growth.py inputImageFileName.png  

Results are printed to stdout, and may be captured e.g. by bash and passed to color_growth.py this way; the following assumes that this script and getFullPathToFile.sh are both in your PATH:

pathToScript=$(getFullPathToFile.sh get_img_RND_CCC_for_color_growth.py | sed 's/get_img_RND_CCC_for_color_growth: \(.*\)/\1/g')  

var_CUSTOM_COORDS_AND_COLORS=$(python $pathToScript inputImageFileName.png)  

imgAndVideo/get_full_c_bright_h_jch_simplified_palette.py

DESCRIPTION

See comments of get_CIECAM02_simplified_gamut.py. This is that but without modifying j and c; this has full brightness and chroma hues.

USAGE

Run this script through a Python interpreter, without any parameter:

python /path/to/this/script/get_full_c_bright_h_jch_simplified_palette.py  

It creates output files named:

<h_step>_full_c_bright_h_jch_simplified.gamut  
<h_step>_full_c_bright_h_jch_simplified_to_RGB.hexplt  

Where h_step is an integer determined by the value of the h_step variable.

imgAndVideo/get_colors_colorgram.py

DESCRIPTION

Extract N (parameter 2) colors from an image (parameter 1), via Python colorgram library, and print them as RGB values.

USAGE

Run this script through a python interpreter with these parameters:

For example, if the source image is named source.png, and you want to extract 23 colors, run:

python full/path_to_this_script/get_colors_colorgram.py darks-v2.png 23  

To pipe the results to a text file, add a > redirect operator and text file to the end of that command, like this:

python full/path_to_this_script/get_colors_colorgram.py darks-v2.png 23 > darks-v2.rgbplt  

NOTES

imgAndVideo/get_color_sample_grid_sRGB.py

DESCRIPTION

Extracts color samples from an image (parameter 1), divided into a grid of columns and rows, with each color sample taken from the color of each cell in the grid. Prints the samples as RGB values in hexadecimal format.

DEPENDENCIES

python PIL and numpy libraries

USAGE

Run this script through a Python interpreter, with these parameters:

For example, if the source image is named darks-v2.png, and you want to sample from the center of each cell in a grid 16 across (16 columns) and 12 down (12 rows), run:

python full/path_to_this_script/get_color_sample_grid_sRGB.py darks-v2.png 16 12  

To pipe the results to a text file, add a > redirect operator and text file to the end of that command, like this:

python full/path_to_this_script/get_color_sample_grid_sRGB.py darks-v2.png 16 12 > darks-v2.hexplt  

imgAndVideo/get_CIECAM02_simplified_gamut.py

DESCRIPTION

Creates a list of colors expressed as RGB hexadecimal values, from a simplified CIECAM02 color space. Optionally (with a tweak described under USAGE) prints CIECAM02 JCH components instead.

DEPENDENCIES

python, with these packages: numpy, ciecam02, colormap, more_itertools

USAGE

Run through a Python interpreter, without any parameters:

python /path/to/this_script/get_CIECAM02_simplified_gamut.py  

To pipe the results to a new file, do this:

python /path/to/this_script/get_CIECAM02_simplified_gamut.py > CIECAM02_simplified_gamut.gamut  

But you will probably get out-of-gamut warnings (out of range) if you convert to RGB with this--you may ignore them in terms of the script running (you will still get valid output). To suppress error prints by piping them to /dev/null in a Unix environment, but still get the valid hex color code printout, run it this way:

python /path/to/this_script/get_CIECAM02_simplified_gamut.py > oot.txt 2>/dev/null  

You may alternate comments after the OUTPUT OPTIONS comment for either JCH (simplified CIECAM02 gamut) or RGB HEX output.

imgAndVideo/get_CIECAM02_simplified_gamut-colorspacious.py

DESCRIPTION

Creates a list of colors expressed as RGB hexadecimal values, from a simplified CIECAM02 color space. Names the output file partly after the number of elements in the list. Variant of script that uses one ciecam02 python library; this uses colorspacious, which at this writing I seem not to understand (or maybe it had errors) and it sometimes produces very out of place colors.

DEPENDENCIES

python, with these packages: numpy, colorspacious, colormap, more_itertools.

USAGE

Run this script through a Python interpreter, without any parameters:

python /path/to_this_script/get_CIECAM02_simplified_gamut.py  

Produces a file named _from_CIECAM02_simplified_as_RGB.hexplt.

NOTE

To change the number of output colors, hack the scripts' variable assignments to J_step, C_step and h_step.

imgAndVideo/getNshadesOfGrayRGB.py

DESCRIPTION

Prints N shades of gray (parameter 1) as calculated in the RGB color space, only for comparison to any grayscale palette generated by getNshadesOfColorCIECAM02.py. You don't want to use the output of this script, because RGB math doesn't align well with human perception of light/dark/nearness of colors. You want to use getNshadesOfColorCIECAM02.py, because the color space it uses is superior for perceptual grayscale and color shade palette generation.

USAGE

Run this script through a Python interpeter with one parameter, which is the number of shades of gray you want to print in hex-encoded RGB values. For example, this will print 16 shades of gray:

python /path/to_this_script/getNshadesOfGrayRGB.py 16  

To write the printout to a file, use the > operator, like this:

python /path/to_this_script/getNshadesOfGrayRGB.py 16 > 18shadesOfGrayRGB.hexplt  

imgAndVideo/getNshadesOfColorCIECAM02.py

DESCRIPTION

Gets -n shades of any -c color (default white if not passed) via the CIECAM02 color space. Writes results to a new .hexplt file named after color. SEE ALSO get_color_gradient_culori.js. That and this might both do hue shifting (you may not get perceptual hue constancy) in shades (~culori possibly less). For example you might say that shades of yellow look orange. But with shades of gray, this produces results that seem to align more with my idea of neutral gray (between black and white, as seen from optical blending experiments).

DEPENDENCIES

Python and the various import libraries declared at the start of CODE.

USAGE

Run this script through a Python interpeter with the --help parameter for instructions, or read the description sections in the argsparse setup below.
EXAMPLE RUN that produces 16 shades of gray (as it defaults to shades of white if no --COLOR is specified), which the script will write to the file named FFFFFF_12shades.hexplt:

python /path/to_this_script/getNshadesOfColorCIECAM02.py -n 12  

EXAMPLE RUN that produces sixteen shades of magenta, which the script will write to a file named FF00FF_18shades.hexplt:

python /path/to_this_script/getNshadesOfColorCIECAM02.py -n 16 --COLOR FF00FF  

NOTES

imgAndVideo/getNhuesCIECAM02.py

DESCRIPTION

Prints high brightness hues from the CIECAM02 color model in N (parameter -n) steps from 0 to 360 degrees of hue. Colors are printed as RGB colors in hex format.

USAGE

Run this script through a Python interpreter, and pass the script a numeric value for the switch '-n', which is the number of full chroma hues you wish to print. For example, to print 18 hues, run:

python /path/to/this/script/printNhuesCIECAM02.py -n 18  

To write the colors to a .hexplt file for permanent palette storage (recommended), use the > operator:

python /path/to/this/script/printNhuesCIECAM02.py -n 18 > 18_max_chroma_hues_from_CIECAM02.hexplt  

NOTES

imgAndVideo/getNchromasOfColorCIECAM02.py

DESCRIPTION

Gets -n chromatic intensities (different states of saturation) for any -c color via the CIECAM02 color space. Writes results to a new .hexplt file named after the color.

DEPENDENCIES

Python and the various import libraries declared at the start of CODE.

USAGE

Run this script through a Python interpeter with the --help parameter for instructions, or read the description sections in the argsparse setup below.
EXAMPLE RUN that produces 16 chromacities of medium blue, which the script will write to the file named 0041ff_6_chromas.hexplt:

python /path/to_this_script/getNchromasOfColorCIECAM02.py -n 7 --COLOR 0041ff  

NOTES

imgAndVideo/color_wander.py

DESCRIPTION

Renders a PNG image like a single colored bacteria which walks randomly over a surface and randomly mutates (and paints) color as it goes. This is a snapshot of colorGrowth.py which I've decided deserves its own variant script named this. Output file names are random. Inspired and drastically evolved from colorFibers.py, which was horked and adapted from https://scipython.com/blog/computer-generated-contemporary-art/

DEPENDENCIES

python 3 with the various modules installed that you see in the import statements here near the start of this script.

USAGE

Run this script through a Python interpreter without any parameters, and it will use a default set of parameters:

python /path/to/this/script/color_wander.py  

To see available parameters, run this script with the -h switch:

python /path/to/this/script/color_wander.py -h  

imgAndVideo/color_growth_inky_flow_glitch.py

DESCRIPTION

This is saved as a new script from a development version of colorGrowth.py which has unintended functionality, which is that colors, soon after they have already been filled, still spawn new coordinates and fill them with mutated color for a while. With the -a 1 switch passed to the script and saved animation frames strung together into a video render (e.g. via ffmpegAnim.sh), this appears like ink flowing after it has been poured. This is however much more computationally expensive to simulate, so I saved this development glitch script separate (not intended to be in the final). Renders a PNG image like colored, evolved bacteria (they produce different colors as they evolve) grown randomly over a surface. Output file names are based on the date and add random characters. Inspired and drastically evolved from colorFibers.py, which was horked and adapted from https://scipython.com/blog/computer-generated-contemporary-art/

DEPENDENCIES

python 3 with the various modules installed that you see in the import statements here near the start of this script.

USAGE

Run this script through a Python interpreter without any parameters, and it will use a default set of parameters:

python /path/to/this/script/color_growth_inky_flow_glitch.py  

To see available parameters, run this script with the -h switch:

python /path/to/this/script/color_growth_inky_flow_glitch.py  

imgAndVideo/color_growth_fast.py

DESCRIPTION

The content of this file was pasted over color_growth.py; SEE THAT. This file is where an improved version of color_growth.py was forked to (by scribblemaniac), but that improvement was pasted over the original. This file is only here because web links may point to this, and I don't want anyone to hit a dead end looking for it.

imgAndVideo/color_growth.py

DESCRIPTION

Renders a PNG image like bacteria that mutate color as they spread. TRY IT. The output is awesome.

DEPENDENCIES

python 3 with numpy, queue, and pyimage modules installed (and others--see the import statements).

USAGE

Run this script through a Python interpreter without any parameters, and it will use a default set of parameters:

python /path/to_this_script/color_growth.py  

To see available parameters, run this script with the --help switch:

python /path/to_this_script/ --help  

NOTES

KNOWN ISSUES

See help for --RANDOM_SEED.

imgAndVideo/color_fibers.py

DESCRIPTION

Renders a PNG image like colored horizontal plasma fibers via python's numpy and PIL modules. Output file names are random. Horked and adapted from https://scipython.com/blog/computer-generated-contemporary-art/

DEPENDENCIES

python 3 with numpy and PIL modules.

USAGE

Run through a Python interpreter without any parameters:

python path/to/this/script/color_fibers.py  

imgAndVideo/artRage2imgs.py

DESCRIPTION

Reworks an ArtRage script file to export a new image after every brush stroke. These may be strung together e.g. with ffmpegAnim.sh to create a video (animation) of the progress of a created painting from start to finish.

USAGE

NOTES

WISH LIST

Option to save a new animation frame after every sub-brush stroke (strokes are composed of multiple shorter strokes, logically, in a script), if that's even possible.

imgAndVideo/NrandomHexColorSchemesGrayMath.py

DESCRIPTION

Generates a random hex color scheme of file format .hexplt, which is a plain text file with one hex color per line. The generated colors are constructed according to a color theory given in Itten's "ELEMENTS OF COLOR," which states that color combinations tend to be more pleasing to the human eye if, when the colors are mixed (by substractive color mixing), they make gray. This script makes colors that are mixed by additive light (RGB), but the principle is the same and the results have generally verified the theory. EDIT: except not. The way this script is constructed you won't generally ever get brilliant intensity colors by default. I'm not sure anymore things would combine to a tint of gray. You'll almost always want to further modify any resulting palettes that you like; they would be a basis for further work. This is a creative brainstorming tool at best.

USAGE

Run this script through a Python interpreter, with the --help parameter or examine the parser = argparse code in this script:

python path/to_this/script/NrandomHexColorSchemesGrayMath.py --help  

-- and examine the help print. Or examine the help= strings in the source code.

fileNamesAndTimestamps/titleCaseAllFiles.py

analyse_module.py

DESCRIPTION

Prints information about a Python module, such as functions. re: https://stackoverflow.com/a/31005891

USAGE

Run through the Python interpreter, with this script as the first parameter (to python) and the script to analyze as the second parameter:

python /path_to/this_script/analyse_module.py module_script.py  

recipes/padImageForInstagram.sh

DESCRIPTION

Using other scripts, pads an image to fit Instagram's blasted aspect constraints (if need be), writing to a new file, using a padding (background) color which is one randomly selected color from a dynamically made palette (quantization) inspired of the image.

DEPENDENCIES

getDoesIMGinstagram.sh, color-thief-jimp-palette.js, padImage.py, getFullPathToFile.sh, and their various dependencies. (Yeesh, this is a frankenassembly that uses three different scripting languages.)

USAGE

Run with these parameters:

For example:

padImageForInstagram.sh _EXPORTED_2023-07-19zb_v03.tif  

imgAndVideo/ripAndTagRatedSheep.sh

DESCRIPTION

Copies the video stream (lossless transcoding) of rated electric sheep .avi files (from the electric sheep content folder) into .mp4 videos in a specified directory. Examines the list_member.xml file to do so.

DEPENDENCIES

Electric Sheep screensaver, a 'Nixy environment (coded for MSYS2 on Windows)

USAGE

Set the variables at the start of the script per the locations of various files in your Electric Sheep screensaver install, and run the script without any parameter:

ripAndTagRatedSheep.sh  

fileNamesAndTimestamps/listMatchedFileNamesOfType.sh

DESCRIPTION

Calls listMatchedFileNames.sh for every file with extension (or file type) $1 in the current directory.

USAGE

Run with these parameters:

Mode 1 prints unaltered output from calling listMatchedFileNames.sh, which at this writing means it prints all file names or directories that are base name matches for type $1.
Mode 2 causes the script to only list file names and how many matches were found, like this:

fBnhR9Ar.hexplt: 8  
YWgZmFP3.hexplt: 5  

Mode 3 causes the script only to print notifications when a file has no match.

EXAMPLES

To run listMatchedFileNames.sh for every filename in the current directory that ends with .hexplt, run:

listMatchedFileNamesOfType.sh hexplt  

To run for every hexplt file in mode 2, run:

listMatchedFileNamesOfType.sh hexplt mode=2  

imgAndVideo/getRandomPaletteFileName.sh

DESCRIPTION

Retrieves a random palette from the /palettes subdirectory of the _ebPalettes repository, and prints the file name of it. Optionally copies the file to the current directory.

DEPENDENCIES

An environment variable export of EB_PALETTES_ROOT_DIR set in ~/.bashrc (in your home folder) which contains one line, set with a Unix-style path to the folder where you keep hex palette (.hexplt) files (for example /some_path/_ebPalettes/palettes). See _ebPalettes/setEBpalettesEnvVars.sh.

USAGE

Run with the following paramters:

For example, to only print a random palette file name, run:

getRandomPaletteFileName.sh  

To print a random palette file name and also copy it into the current directory, run e.g.:

getRandomPaletteFileName.sh BRICKSLORF  

To assign the file name of the retrieved pallete to a variable available in a calling shell, run this script via source, this way:
source getRandomPaletteFileName.sh
-- and the file name of the retrieved palette will be available as $RNDpaletteFileName in the calling shell.

imgAndVideo/printAllPaletteFileNames.sh

DESCRIPTION

Retrieves and prints all palette file names from the /palettes subdirectory (and all directories below it) in the _ebPalettes repository. Optionally copies all of them to the current directory as well. Also optionally prints the full path of each palette (by default only prints the file name).

DEPENDENCIES

An environment variable export of EB_PALETTES_ROOT_DIR set in ~/.bashrc (in your home folder) which contains one line, set with a Unix-style path to the folder where you keep hex palette (.hexplt) files (for example /some_path/_ebPalettes/palettes). See _ebPalettes/setEBpalettesEnvVars.sh.

USAGE

Run with the following parameters:

EXAMPLES

To print all palette file names without their path (file name only), run it without any parameters:

printAllPaletteFileNames.sh  

To print all palette file names and also copy them to the current directory, run:

printAllPaletteFileNames.sh -c  

To print all palette file names including the full path to each, run:

printAllPaletteFileNames.sh --fullpaths  

Or combine -c and -f to print full paths and copy palettes:

printAllPaletteFileNames.sh -c -f  

NOTES

imgAndVideo/SVGrandomColorReplace.sh

DESCRIPTION

Takes an .svg file and fills all regions of one color (default ffffff, white) with randomly generated colors (not recommended -- random colors can be garish), OR from colors randomly selected from a .hexplt color list (recommended, optional). SEE ALSO SVGrandomColorReplaceCopies.sh AND SVGsRandomColorReplace.sh.

WARNING

Changes (overwrites) input svg file without warning. You may wish to only operate on a copy of the svg file, or make many copies and alter them by calling this script from another script, such as SVGrandomColorReplaceCopies.sh.

DEPENDENCIES

If you use random palette selection, you need a local install of the _ebPalettes repository, and working copy of the the printContentsOfRandomPalette_ls.sh script, with its dependencies.

USAGE

Run with these parameters:

Example that will replace every color fill of ffffff (white) in input.svg with randomly generated sRGB colors:

SVGrandomColorReplace.sh input.svg  

Example that will replace every color fill of ffffff (white) in input.svg with randomly selected colors from eb_favorites_v2.hexplt:

SVGrandomColorReplace.sh input.svg eb_favorites_v2.hexplt  

Example that will replace every color fill of 000000 (black) in input.svg with randomly selected colors from earth_pigments_dark.hexplt:

SVGrandomColorReplace.sh input.svg earth_pigments_dark.hexplt 000000  

NOTES

imgAndVideo/SVGrandomColorReplaceCopies.sh

DESCRIPTION

calls SVGrandomColorReplace.sh $1 times with additional parameters to be passed on to that script (see USAGE), but creating copies of the source svg (named after pattern Y_m_d__H_M_S__N), and in a subfolder named after the original file plus random characters) before calling that script to modify the copies. See also SVGsRandomColorReplace.sh, which calls this repeatedly for every SVG file in the current directory. See NOTES under USAGE for another script to use instead of or with this.

USAGE

Run with these parameters:

Example that will create 38 copies of 2021-09-13-zb_v5.svg with random color replacements via optional parameter $3 (a source .hexplt file, earth_pigments_dark.hexplt), replacing hex color 000000 via optional parameter $4:

SVGrandomColorReplaceCopies.sh 2021-09-13-zb_v5.svg 38 earth_pigments_dark.hexplt 000000  

NOTES