Black Lines on a White Background forming a Grid

C:\alpha\gmic\gmic.exe `
    input 1001,501,1,3,255 `
    grid 10,10,0,0,1,0,0,0 `
    output C:\alpha\output\gmic_grid_white.png

The command is copy/pastable into the Win 10 PowerShell Command Line... though, I pretty much doubt your copy of G'MIC is located on the same path as mine.


Shall we do this again?

White Lines on a Black Background forming a Grid

C:\alpha\gmic\gmic.exe `
    input 1001,501,1,3 `
    grid 10,10,0,0,1,255,255,255 `
    output C:\alpha\output\gmic_grid_black.png

First, a breakdown of: input 1001,501,1,3
Was that useful?

grid 10,10,0,0,1,255,255,255

What I am using is a shortened version of the full parameter list. Since I have never been able to get the 'pattern' to work (to display anything but a solid line), I see no point in including that optional parameter.

grid 10,10,0,0,1,0xCCCCCCCC,255,255,255

command x_spacing, y_spacing, x_offset, y_offset, opacity, pattern, red, green, blue

I used spaces (for display purposes, so the command does not run off the page), but G'MIC does not accept spaces between parameters. A space means new_command or new_parameter_set. All of the parameters need to be crammed together.

Red Lines on a Purple Background forming a Grid

C:\alpha\gmic\gmic.exe `
    input 501,501,1,3 `
    fill_color 124,0,255 `
    grid 50,50,25,25,1,255,0,0 `
    line 0%,0,100%,0,1,255,0,0 `
    line 0%,1,100%,1,1,255,0,0 `
    line 0%,499,100%,499,1,255,0,0 `
    line 0%,500,100%,500,1,255,0,0 `
    line 0,0%,0,100%,1,255,0,0 `
    line 1,0%,1,100%,1,255,0,0 `
    line 499,0%,499,100%,1,255,0,0 `
    line 500,0%,500,100%,1,255,0,0 `
    output C:\alpha\output\gmic_grid_purple.png

I actually put together this code prior to the much simpler code at the top of the page. For whatever reason, centering the grid and adding a border came into my head prior to resizing the image.

Go figure.

command line image manipulations

© copyright 2020 Brett Paufler