A simplified compiler for the Pixel image processing DSL, built with MLIR.
Compiles .px scripts that process BMP images using operations like:
invert- Inverts colorsgrayscale- Converts to grayscalerotate- Rotates image by specified degrees
./build.shOr manually:
mkdir build && cd build
cmake ..
make -j4./compile.sh script.pxThat's it! The compiler automatically:
- Parses your
.pxfile - Generates high-level MLIR (Pixel dialect)
- Lowers to LLVM dialect MLIR
- Generates LLVM IR
- Compiles to executable
output_high_level.mlir- High-level Pixel dialectoutput_low_level.mlir- Low-level LLVM dialectoutput.ll- LLVM IRpixel_program- Ready-to-run executable
Run the generated program:
./pixel_program# script.px
image img1 "input" -> "output" as bmp
operations img1:
invert
grayscale
rotate 90