image_conversion_tool.py

LunaEngine Image Conversion Tool

Function:
   Converts images to embedded Python code for use in the LunaEngine graphics engine,
   supporting resolution scaling and multiple encoding methods.

Description:
   Command-line tool for converting images into Python representations that can be
   embedded directly in source code. Offers resizing options, preview capabilities,
   and batch conversion support.

Location:
   lunaengine/tools/image_conversion_tool.py

Libraries Used:
   - os: Path and directory manipulation
   - sys: Argument handling and system control
   - argparse: Command-line argument processing
   - pathlib: Object-oriented path handling
   - pygame: Image processing and preview functionality
   - utils (internal module): ImageConverter and EmbeddedImage for conversion

Global Functions

def main() -> Any

No documentation

def show_preview(original_path: Path, var_name: str, python_code: str, target_size: tuple) -> Any

Show a preview of the original and converted image

def print_statistics(original_path: Path, output_path: Path, var_name: str, python_code: str) -> Any

Print conversion statistics

def batch_convert() -> Any

Batch convert multiple images

Back to Tools Module