Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.
/ bmp2coe Public archive

Converts BMP file to Xilinx Vivado coefficient file (COE)

License

Notifications You must be signed in to change notification settings

davidxuang/bmp2coe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

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)

Topics

Resources

License

Stars

Watchers

Forks