# module `convert`
---
## function `getNewPixels`
```python
getNewPixels(baseImage: ImageFile | str, newImage: ImageFile | str) → list
```
Compare two images and return the pixels that are different in the second image as an ImageFile and the corresponding bounding box
---
## function `toPBytes`
```python
toPBytes(im: ImageFile, index: list = []) → list
```
Convert an ImageFile to bitflip array bytes, here referred to as pBytes or pixel bytes, then return the index
---
## function `fromPBytes`
```python
fromPBytes(pBytes: bytes) → list
```
Convert bitflip array into pixels then return the 1 dimensional list of pixels
---
## function `loadHexPalette`
```python
loadHexPalette(palette: str) → list
```
Load hex palette from the file at the path passed in by the palette parameter, convert it to an RGB index and return the index
---
## function `toSR`
```python
toSR(imPath: str, outPath: str, scale: int = 1, palette: int | bool = False)
```
Convert the image at imPath to an SR at outPath, optionally accepting a scaling factor for rendering and a predefined palette to use instead of auto building one
---
## function `toSRB`
```python
toSRB(
framesGlob: str,
outPath: str,
scale: int = 1,
frameOffsetMS: int = -1
) → None
```
Convert the frames at framesGlob to an SRB at outPath, with an optional scaling factor and frame offset
---
## function `toStill`
```python
toStill(srPath, outPath, palette: bool | str = False) → None
```
Convert SR file to still image, optionally provide a palette for palette dependent files or for palette swapping
---
## function `toAnimation`
```python
toAnimation(
srlPath,
outPath,
format: str | bool = False,
outputFrames: bool = True
)
```
Write SRB frames to disk as either a set of files or a single animated webp or gif
---
_This file was automatically generated via [lazydocs](https://github.com/ml-tooling/lazydocs)._