The goal of this document is to show an example of a processing flow using images. The steps to be followed to build new image processing pipes and how the new flow would be defined are described below. The script for this example can be found at the Github repository:
[https://github.com/miferreiro/bdpar/blob/master/articleExample/exampleImage/exampleImage.R](https://github.com/miferreiro/bdpar/blob/master/articleExample/exampleImage/exampleImage.R)
Example
First of all, it is necessary to include the *bdpar* package and the *imager* package, which will be used to read and transform the images.
```{R, echo = TRUE, results = "hide", eval = FALSE}
library(bdpar)
library(imager)
wzxhzdk:0
Secondly, it is necessary to indicate to bdpar with which extension the created extractor is associated, in this case, .png.
```{R, echo = TRUE, results = "hide", eval = FALSE}
extractors <- ExtractorFactory$new()
extractors$registerExtractor(extension = "png", extractor = ExtractorImage)
wzxhzdk:1
Once the pipes to be used have been created, it is time to build the flow of pipes to be used using the DynamicPipeline class.
```{R, echo = TRUE, results = "hide", eval = FALSE}
pipeline <- DynamicPipeline$new(pipeline = list(Image2Pipe$new(),
ImageCroppingPipe$new(),
ImageResizePipe$new()))
wzxhzdk:2