davidxuang / bmp2coe

Converts BMP file to Xilinx Vivado coefficient file (COE)

Repository from Github https://github.comdavidxuang/bmp2coeRepository from Github https://github.comdavidxuang/bmp2coe

bmp2coe

GitHub license

bmp2coe is made for generating coefficient files for Xilinx Vivado from bitmap files.

Usage

ffmpeg -y -i input.png -pix_fmt {bgr24 | rgb444le} output.bmp
./bmp2coe.ps1 [-PixelFormat] {bgr24 | rgb444le}

The script will convert all .bmp files in the same folder. One of the following pixel formats must be specified (all formats use bottom-up row order and will append a padding pixel to each row if the image width is an odd number):

  • bgr24 as exported by FFmpeg, which uses compact BGR pixel layout. The output file will use 8-bit wordlength.

  • rgb565le as exported by FFmpeg, which uses 5R6G5B little-endian pixel layout. This may work for rgb555le (1A5R5G5B little-endian) as well. The output file will use 16-bit wordlength.

  • rgb444le as exported by FFmpeg, which uses 4A4R4G4B little-endian pixel layout. The output file will use 12-bit wordlength.

Note that FFmpeg will apply dithering to the image when operates bit depth reduction by default.

About

Converts BMP file to Xilinx Vivado coefficient file (COE)

License:MIT License


Languages

Language:PowerShell 100.0%