Skip to content

degrade

Create degraded versions of images for upscale/enhance training. No extra dependencies — pure Pillow.

Usage

bash
datasety degrade --input ./originals --output ./dataset --type random --paired

Degradation Types

TypeEffect at intensity=1.0
lowres16x bilinear downscale + nearest upscale
oversharpenAggressive unsharp mask (percent=1000)
noise50% Gaussian noise blend
blurRadius 3px Gaussian blur
jpegQuality 5 JPEG compression
motion-blurHorizontal motion blur
pixelate16x nearest-neighbor pixelation
color-bands3-bit posterization
upscale-sim8x bilinear down + Lanczos up

Options

OptionDescriptionDefault
--input, -iInput directory(required*)
--output, -oOutput directory(required*)
--input-imageSingle input image
--output-imageSingle output image
--type, -tDegradation type(s), repeatablerandom
--intensityGlobal intensity 0.0-1.00.5
--intensity-rangeRandom range MIN-MAX
--chainApply multiple types sequentiallyfalse
--num-variantsVariants per input image1
--pairedCreate control/ + target/ subdirsfalse
--seedRandom seed(random)
--output-formatpng, jpg, webppng
--skip-existingSkip images with existing outputfalse
--workersParallel workers for processing1
--progressShow tqdm progress barfalse
--dry-runPreview without writing filesfalse

Examples

bash
# Random degradation for upscale training
datasety degrade -i ./originals -o ./dataset --type random --intensity-range 0.2-0.8 --paired

# Chain specific degradations
datasety degrade -i ./images -o ./degraded --type jpeg --type noise --chain --paired

# Multiple variants per image
datasety degrade -i ./images -o ./degraded --type random --num-variants 3 --seed 42

Released under the MIT License.