View on GitHub

Contemporary_CDV

Contemporary Carte de Visite Tools: Raccolta di utility per la preparazione delle immagini da stampare su supporti fotografici standard

Download this project as a .zip file Download this project as a tar.gz file

% MONTAGGIODORSI(1)
% Roberto Ceccarelli - Casasoft
% April 2023

NAME

MontaggioDorsi - Assembling six images over a 20x27 cm paper

SYNOPSIS

MontaggioDorsi [options]* inputfile+

DESCRIPTION

This program gathers six images on a 20x27cm surface
that I print on a cardboard coated only on the side of the image.

OPTIONS

–paper=VALUE :
Output paper size:
Large (default) 20x27cm
Medium 15x20cm
A4 210x297mm

–gravity=VALUE :
canvas gravity, valid values are:
Northwest
North
Northeast
West
Center
East
Southwest
South
Southeast

–fillcolor=VALUE :
set the color used to fill the images
(default #FFFFFF)

–bordercolor=VALUE :
set the color used to border the images
(default #000000)

–dpi=VALUE :
set output resolution (default 300)

–json=VALUE :
parameters in json format,
use –helpjson for sample template
Text can be stored in a file instead of a string
The file must be referenced as ‘@filename’

–script=VALUE :
c# script for custom processing,
use –helpscript for sample template
Text can be stored in a file instead of a string
The file must be referenced as ‘@filename’

-o, –output=VALUE :
set output dir/filename

–extension=VALUE :
file extension for output file (default ‘jpg’)

–tag=VALUE :
extra info for user scripts
Text can be stored in a file instead of a string
The file must be referenced as ‘@filename’

–nobanner :
suppress the banner

-h, –help :
show this message and exit

–helpjson :
show json parameters template

–helpscript :
show script template

–man :
show the man page source and exit

–colors :
list available colors by name

–license :
show program license (AGPL 3.0)

COLORS

Colors can be written in any of these formats:
#rgb
#rrggbb
#rrggbbaa
#rrrrggggbbbb
#rrrrggggbbbbaaaa
colorname (use MontaggioDorsi –colors to see all available colors)

JSON

Parameters can also be passed with a json formatted string
using the following template:

{
  "Paper": null,
  "CanvasGravity": 0,
  "FillColor": "#FFFFFF",
  "BorderColor": "#000000",
  "Dpi": 300,
  "OutputName": "",
  "Extension": "jpg",
  "Script": null,
  "Tag": null,
  "FilesList": []
}

ENVIRONMENT VARIABLES

The program can read values from these variables:

CDV_OUTPATH :
Base path for output files

CDV_DPI :
Resolution for output files

CDV_FILL :
Color used to fill images

CDV_BORDER :
Border color

SCRIPTING

You can add custom c# code, compiled at runtime, with the –script parameter. You can call a property engine that exposes all the parameters passed to the main program.

The following using are declared:


using Casasoft.CCDV;
using Casasoft.CCDV.Engines;
using Casasoft.CCDV.JSON;
using ImageMagick;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

These are the signatures of the scriptable methods:

// Script template for MontaggioDorsi

/// <summary>
/// Custom class initialization
/// </summary>
public void Init() { }

/// <summary>
/// Image for final output
/// </summary>
/// <returns></returns>
public MagickImage OutputImage() => null;

/// <summary>
/// Preprocesses the loaded image
/// </summary>
/// <param name="image">The loaded image</param>
/// <returns>The Processed image</returns>
public MagickImage ProcessOnLoad(MagickImage image) => image;

BUILT-IN IMAGES AND RENDERS

Instead of a filename you can use the following built-in templates:

xc:color :
Fill the image with the specified color

gradient:color1-color2 :
Fill the image with linear gradient from color1 to color2, if colors are omitted is white to black

radial-gradient:color1-color2 :
Radial gradient as above

plasma:color1-color2 :
Plasma gradient from color1 to color2, if colors are omitted is black to black

plasma:fractal :
Creates a random plasma

label:text :
Render the plain text with no word-wrap

caption:text :
Render the plain text with auto word-wrap

pango:text :
Render the text with pango markup

The parameters can be stored in a file instead of a string.
The file must be referenced as ‘@filename’

COPYRIGHT

Casasoft Casasoft MontaggioDorsi is free software:
you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

You should have received a copy of the GNU AGPL v.3
along with Casasoft Casasoft MontaggioDorsi.
If not, see http://www.gnu.org/licenses/.

DISCLAIMER

Casasoft Casasoft MontaggioDorsi is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.