Skip to content

Image preprocessing ​

Preprocessing executes once on the master source image prior to rendering target formats. This ensures adjustments such as color grading, auto-cropping, and watermarks remain uniform across the entire brand asset collection.

The sequence of processing operations:

  1. Background removal
  2. Background color / gradient fill
  3. Edge smoothing
  4. Noise reduction
  5. Auto-crop
  6. Color adjustments: grayscale, B&W, invert, hue, temperature, saturation, brightness, contrast
  7. Sharpen or blur
  8. Vignette
  9. Drop shadow
  10. Watermark

Color adjustments ​

ControlForm fieldDefaultDescription
GrayscalegrayscalefalseConverts RGB channels to luminance while preserving alpha transparency
Black & whitebwfalseHigh-contrast binarization to pure black and pure white
InvertinvertfalseInverts RGB values while retaining alpha values
Hue shifthue_shift0Rotates color hue in degrees (-180° to +180°)
Temperaturetemperature0Warm (positive, red-shifted) to cool (negative, blue-shifted), -100 to +100
Saturationsaturation1.00.0 is fully desaturated, 1.0 is neutral, >1.0 enhances vibrance
Brightnessbrightness1.0Multiplier scale matching saturation
Enhance contrastenhance_contrastfalseApplies automated histogram contrast equalization

Grayscale vs B&W

grayscale preserves smooth midtone tonal gradients and is recommended for monochrome brand variations. bw applies binary thresholding, best suited for testing stencil legibility.

Sharpness and filtering ​

ControlForm fieldDefaultNotes
SharpensharpenfalseApplies unsharp masking
Sharpen radiussharpen_radius1.0Controls filter radius (higher values produce broader halos)
Blurapply_blurfalseApplies Gaussian blur
Blur radiusblur_radius2Radius in pixels at source resolution
Noise reductionnoise_reductionfalseMedian filter; utilizes OpenCV when present
Noise strengthnoise_strength1Kernel size: higher values increase smoothing
Enhance qualityenhance_qualityfalseCombined contrast, sharpening, and color correction pass

Sharpening and blurring are counteracting operations. Enabling both applies them sequentially, introducing blurring with halo artifacts. Select the single filter appropriate for your source.

Composition & framing ​

ControlForm fieldDefaultNotes
Auto-cropauto_cropfalseTrims empty or uniform borders down to active subject bounds
Crop paddingcrop_padding10Margin in pixels retained around the subject after boundary trimming
VignettevignettefalseApplies radial perimeter darkening
Vignette strengthvignette_strength0.5Intensity scale: 0.0 to 1.0

Auto-crop is particularly effective for logos exported with wide transparent margins. Combining auto-crop with 10-20 px padding ensures the mark fills all output canvases proportionally.

Drop shadow ​

ControlForm fieldDefault
Enableshadow_effectfalse
Opacityshadow_opacity0.3
Blur radiusshadow_blur4
Offset Xshadow_offset_x5
Offset Yshadow_offset_y5

Drop shadows are calculated from the alpha boundary. This requires an image with an active alpha channel, originating either from a transparent PNG/WebP source or via background removal.

Watermark overlay ​

ControlForm fieldDefault
Enableadd_watermarkfalse
Textwatermark_text© BrandKit
Opacitywatermark_opacity0.3

Watermarks render using Pillow bitmap rendering unless custom system TrueType fonts are mounted. Configure default text in config.json.

Output encoding options ​

These settings operate during per-canvas encoding rather than global preprocessing:

ControlForm fieldDefaultNotes
Qualityquality95Applies to JPEG and WebP; ignored by PNG and ICO
Strip metadatastrip_metadatafalseDiscards ICC color profiles and leftover metadata from output files

Source EXIF handling

Uploaded master images are re-encoded through Pillow upon ingestion, which strips camera and GPS EXIF metadata. The strip_metadata parameter controls downstream target asset headers. Consult Privacy.

Customizing defaults ​

Default parameter values are declared under preprocessing_options in config.json. Modifying this structure alters the initial UI state.