The goal of this project is to provide an easily configurable pipeline to process images for web publishing.
Features:
- Resizing and cropping of images
- Easily resize and image to various sizes for responsive websites
- JPEG optimization with mozjpeg
- Multiprocessing
- Conversion between formats (including WebP)
> image_pipeline --help
> Usage: image_pipeline [OPTIONS] [CONFIGURATION_FILENAME]
Options:
--help Show this message and exit.
Examples:
# if your configuration file is named image_pipeline.yaml
image_pipeline
# otherwise pass the name
image_pipeline example_configuration.yaml
This configuration will take all pictures from the folder exmaple-data
and create 3 variants for each picture. example-data/test.jpeg
will
become
example-data/output/test-small.jpeg
,
example-data/output/test-medium.jpeg
and
example-data/output/test-large.jpeg
with the correct resolution. It will make use of multiprocessing and
the mozjpeg library to achieve the best result.
multiprocessing:
active: true
processes: 4
mozjpeg:
active: true
directories:
- path: "example-data"
output:
fileFormat: 'JPEG'
path: "example-data/output"
prefix: ''
formats:
- name: small
width: 200
quality: 70
- name: medium
width: 400
quality: 80
- name: large
width: 800
quality: 80
Turn multiprocessing on or off
multiprocessing:
active: true|false
processes: 4
configure the use of the mozjpeg library for jpeg compression
mozjpeg:
path: /opt/mozjpeg/bin/
active: true
path: 'example-data'
output: OutputDirectory
If fileFormat
is empty, the pipeline try to output it in the same
format.
fileFormat: 'JPEG'|'PNG'|'WEBP'
path: 'example-data/output'
prefix: ''
formats: [OutputFormat]
Quality is only respected for JPEG compression. If quality is set to null, image-pipeline will try to use lossless compression for JPEG. Default quality is 80, if not specified.
name: 'asdf'
width: 200
height: 200
quality: 80 | null
- Caching
- Dockerfile
- PNG optimization
- Hanlde EXIF data
- Add SVG placeholder functionality