Image Module
API for converting image files to Free-Wili (fwi) files.
Image Examples
Convert an image to an fwi file
from freewili.image import convert
# Convert PNG to FWI
match image.convert("my_image.png", "my_image.fwi"):
case Ok(msg):
print(msg)
case Err(msg):
exit_with_error(msg)
fwi-convert command line interface
Included in the freewili module is command line interfaces to allow easy interactions with this API.
$ fwi-convert --help
usage: fwi-convert [-h] -i INPUT -o OUTPUT [--version]
options:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Path to a JPG or PNG image to be converted
-o OUTPUT, --output OUTPUT
Output filename for the fwi file
--version show program's version number and exit
Image module API
Module to create a FreeWili image file.
- freewili.image.convert(input_file: Path, output_file: Path) Ok[str] | Err[str]
Convert a PNG or JPEG image to a FreeWili image file (fwi extension).
Parameters:
- input_filepathlib.Path:
Path to the input image file (PNG or JPEG).
- output_filepathlib.Path:
Path to the output image file (.fwi).
Returns:
- Result[str, str]:
Ok(str) if the command was sent successfully, Err(str) if not.